Compliant with SemVer spec.
- The
reducers
config property, can be not only a dictionary but an array of dictionaries.
dispatch
method- better timestamp
- configurable global variable name
- Store has now a new
onDispatch
callback to "listen" store's dispatches
- new
state
getter for the current state - new
listPayloads
list that includes the payloads - new list column with the elapsed time for reducer's execution
Sections simplifies the creation of root properties of apps or big components.
Reducer's dispatch method accepts as 3rd argument a configuration object of IDispatchConfig
interface.
Currently, this interface has only the triggerChange: boolean
with default value true
.
Setting the triggerChange
to false
a dispatch
can ask from Dynadux to do not trigger the change
.
Inside reducer's (action's) implementation, Dynadux is offering the blockChange()
method. In this way, reduce itself can block the onChange
call.
With this breaking version, only the Debugger's Configuration is changed.
The globalVariableName
config property has been renamed to debuggerStoreName
, and it is required.
Now, the debugger would always be included in the Stores, even in production, since the debugger is activated only when the debuggerStoreName
is not an empty string.
For more read the Debugging section.
The dispatch's config prop triggerChange
is renamed to blockChange
with opposite logic.
The triggerChange
has still backward compatibility with console warn till next major release.
You can register/unregister listeners for Store's or Section's changes.
The events approach is a kinda anti-pattern for state managers and for Dynadux as well. So it is not encouraged to use them, so they are not documented at least at the moment. Events are not going to be removed and are stable.
Events are used internally to support the react-dynadux
.
Feature: Support React Provider react-dynadux
createStore
result also returns the provider
property, needed by the react-dynadux
.
Catches the errors from middlewares and reducers, since uncaught errors block later dispatches.
The error is now consoled.
middlewares
array accepts false
, null
and undefined
values for inline comparison (ternary operators).
An action
can be overloaded. That means a reducer of another Section can implement the same action.
This allows actions to be used as events.
There was a bug where if an implementation of an overloaded action return no change, the change wasn't applied.
- FAQ Frequently asked questions
- React How to use it in react
- Examples Live examples. Examples compared to redux's implementations
- Terminology Terminology of dynadux, (is small!)
- Typescript Tips for Typescript implementations
- History, Undo/Redo Middleware for History, Undo/Redo and Restore Points
- React Dynadux Provider for Dynadux App Stores
- 🏠 Home, Contents