Overrides

There is some possible override to change the default way of working of the application.

You can find examples of all of these in Advanced

Defaults

Default overrides will change the default way of work for all the rules created after the change.

Default suffix types

Default suffixes types will be added automatically to the main type of the rule.

Main type is declared when creating an instance of the rule (Constructor String).

Default suffix types are:

PENDING, FULLFILLED, REJECTED

These events are the only that are managed by the library.

Initial State generator

You can change the initial state generator to have another initial state closer than what you expect.

Reducer generator

This allow you to change the reducer generator. This function have to create Javascript Object with the "type-to-reducer" schema (https://github.com/tomatau/type-to-reducer).

Action Transformer function

This is a specific usage. This function is here to transform any "action" before sending it to the reducer.

The default action transformer is identity. But you can override it to transform "payload" to "data" field for example.

Rule

But you can override some behaviour for special rules even if you have changed the default one (see before).

Instance of Rule can have override on these cases :

  • Initial State generator

  • Reducer generator

  • Action Transformer function

results matching ""

    No results matching ""