Files
habitica/website/client/store/actions/user.js
T
Matteo Pagliazzi d9d7c69432 Client: async resources, make store reusable, move plugins and add getTaskFor getter (#8575)
Add library to manage async resource
Make Store reusable for easier testing
Move plugin to libs
Add getTaskFor getter with tests
2017-03-18 18:33:08 +01:00

13 lines
322 B
JavaScript

import { loadAsyncResource } from 'client/libs/asyncResource';
export function fetch (store, forceLoad = false) { // eslint-disable-line no-shadow
return loadAsyncResource({
store,
path: 'user',
url: '/api/v3/user',
deserialize (response) {
return response.data.data;
},
forceLoad,
});
}