react-cmf-cqrs
v0.111.0
Published
A framework built on top of best react libraries
Downloads
23
Readme
Content Management Framework for CQRS (aka cmf-cqrs)
This is a library to help you to build configurable React App with CQRS pattern.
Breaking changes log
Before 1.0, react-cmf-cqrs
do NOT follow semver version in releases.
You will find a list of breaking changes here.
##Content
This package provides tools to deal with cqrs backend allowing websocket handling :
- acknowledgement actions
- ACKDispatcher component
- Smart Websocket middleware
- ACK reducer
##How it works
- to start the websocket with smartWebsocket middleware :
ws = new SmartWebsocket(urlPrefix, {
onOpen: () => dispatch({ type: ACTION_TYPES.ON_OPEN }),
onClose: () => dispatch({ type: ACTION_TYPES.ON_CLOSE }),
onMessage: (messageEvent) => {
dispatch({ type:onMessage, message:messageEvent });
},
});
In onMessage event, you should get middleware handlers as well.
- On the reducer, actions handled :
- ACK_ADD_CONTEXT : Used to add a new request on stack
- ACK_RECEIVE_MESSAGE : Used when a message come from the ws
- ACK_DELETE : Used when you want to delete a handler