MCPcopy Create free account
hub / github.com/Lobos/react-ui / handleData

Method handleData

src/higherOrders/Fetch.js:73–85  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

71 }
72
73 handleData (data) {
74 // old dataSource api
75 if (typeof data === 'function') {
76 this.setState({ data: undefined, fetchStatus: FETCH_PENDING });
77 data.then((res) => {
78 if (this._isMounted) {
79 this.setState({ data: clone(res) });
80 }
81 })();
82 } else {
83 this.setState({ data: clone(data), fetchStatus: FETCH_SUCCESS });
84 }
85 }
86
87 getSelected () {
88 return this.component.getSelected(...arguments);

Callers 2

componentWillMountMethod · 0.95

Calls 1

cloneFunction · 0.85

Tested by

no test coverage detected