State-Management Functionality

The functionality required for state management naturally depends on the project's requirements for state management. In the simplest case, the import process receives the data and saves its status. A second asynchronous process then sends the IMPORTED data to the target system and sets its status to SUCCESS or FAILED (separated import and update processes).

The first function we need, of course, is saveState( payload, newState).

Save state will actually be split into updateState( id, state) and createState( playload, initialState). The payload represents the received data from the customer and it should be immutable once the state has been created. Create state returns the id that is used in later context to update an existing state.

The second function that is needed is fetchStates( state) to fetch all records with a certain state.

Your requirements on state-management will probably be more complex than these two basic function.

Last updated