Open jvega opened 6 years ago
I found this option in the bundle but I don't find any doc
Exists a better way to set this option ...
const promise = ({ apiFetch }) => { return apiFetch('resources') } const bundle = createAsyncResourceBundle({ name: 'resource', getPromise: promise }) bundle.doFetchResource =() => args => { const { dispatch } = args dispatch({ type: 'RESOURCE_FETCH_STARTED' }) return promise(args).then( payload => { dispatch({ type: 'RESOURCE_FETCH_FINISHED', payload, merge: true // <- option }) }, error => { dispatch({ type: 'RESOURCE_FETCH_FAILED', error }) } ) }
@jvega good point, would be happy for a PR from someone adding this.
I found this option in the bundle but I don't find any doc
Exists a better way to set this option ...