You can load directly by including myLackey
and call load
giving a specific URI. For example:
import { myLackey } from 'myLackey'
...
componentWillMount () {
myLackey.load('/users')
}
Once you have data lackey available, you can check on the status of the loading:
render() {
const stillLoading = myLackey.loading('/users')
return stillLoading
? <div>Loading...</div>
: <div>...</div>
}
Also available:
loaded(uri)
orloaded(uris...)
returnstrue
if the data is already loaded.failed(uri)
returnstrue
if the data loading promise failed.unload(uri)
orunload(uris)
marks the given URIs unloaded