Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 793 Bytes

File metadata and controls

31 lines (25 loc) · 793 Bytes

Middleware CMF

CMF middleware is loaded by default. It manages collections.

To let the CMF middleware manage your action, add a cmf configuration in your dispatched action.

const action = {
    // action config
    ...
    cmf: {
        // cmf middleware config
    }
}
dispatch(action);

Collections

const action = {
    response: [{...}, ...], // the collection to store
    cmf: {
        collectionId: 'datastores' // the collection storage id
    }
}
dispatch(action);

By dispatching an action containing a collectionId and a response, CMF will store the collection in the app state with the path state.cmf.collections.<collectionId>.

Further information about managing collections is available here.