Releases: ericelliott/autodux
Releases · ericelliott/autodux
Fix nested action objects
This version fixes a bug that caused payloads to nest inside each other. See issue #23
We consider this a breaking change because some users may have worked around the bug by digging into the incorrectly created action object to get at the correct payload key.
If your project breaks when you upgrade to this version, the fix is to find code that digs into a returned action object such that you are accessing action.payload.payload
and update it so that it only tries to read from the top level action.payload
.
Defaults API
Breaking changes:
actions: { action: { create () {} }}
now defaults to pass the first argument through as the payload
Enhancements:
actions: { action: { reduce () {} }}
now defaults to prop assign ({...state, ...payload}
) if omitted (was: Error)- Added
id = x => x
utility function - Added
assign('propName')
utility function to set the provided key in the state to the payload value. - You can now replace the
actions: { action }
object with a function. It will be used as the reducer, assuming the default action creator behavior - More documentation and examples