Releases: jeffbski/redux-logic
v0.15.1
v.0.15.0
Added support for Symbols as type. Thanks @a-marquez
Added additional validation check for misspelled type
keyword. Thanks @matthamil
v0.14.0
Allow configuration of default warnTimeout
New method configureLogic({...})
introduced which allows the configuration of the the global defaults like warnTimeout
import { configureLogic } from 'redux-logic';
// globally configure ALL Logic instance defaults instead of overriding these
// properties on each call to `createLogic`. These defaults will not be applied
// to `Logic` instances that have already been created.
//
// specify all or a subset of the following properties:
configureLogic({
// provide different default values than the package defaults.
warnTimeout: 10000 // use 0 to disable the warning
});
v0.12.4
Fix defect which occurred when using processOptions successType or failType along with validate or transform hook. If the validate or transform hook caused a dispatch then it was incorrectly being wrapped using the processOptions successType or failType. Those options only apply to the process hook.
Merge PR to fix link on API page. Thanks @cherniavskii
v0.12.3
Make rxjs a dependency and document installation notes
To simplify use where a developer only wants to use redux-logic and
doesn't plan to use observables directly, making rxjs a dependency
allows redux-logic to be installed w/o manually installing rxjs first.
It is still recommended to install rxjs first if Observables will
directly be used in the project, so that multiple copies are not
installed. A note was added to the readme.
v0.12.0
v0.12 has a notable non-breaking change. It's purpose is to deprecate single dispatch form of process hook to prepare for a breaking change in v0.13. In development mode using the single dispatch form of process hook will warn in the console. The single dispatch mode was a source of confusion for users and complexity in the source code.
- Single dispatch mode -
process(deps, dispatch)
is deprecated, use the multi-dispatch versionprocess(deps, dispatch, done)
calling done when finished dispatching. - New option
warnTimeout
defaults to 60000 (ms == one minute) which warns (in development build only) when the logic exceeds the specified time without completion. Adjust this value or set it to 0 if you have logic that needs to exceed this time or purposefully never ends (like listening to a web socket).
Migration steps
- Search for logic with process hook defined that uses
dispatch
but notdone
and convert to the multi-dispatch versionprocess(deps, dispatch, done)
calling done when finished dispatching. README and docs/api.md have many examples. - For any long running logic or logic that never ends (like those listening to a web socket), set the new option
warnTimeout
to the milliseconds to wait before warning to the console (defaults to 60000 ms, one minute). For never ending logic, set it to0
to disable the warning.
v0.11.7
add logicMiddleware.addDeps(additionalDeps)
Add a method addDeps
to the logicMiddleware that will allow the injection of additional dependencies that will be available to the hooks (validate/transform/process).
It must be called after the store is created so that everything initializes properly.
It will verify that it is not overriding existing dependencies (unless they are the exact same value/instance), throwing an error if it finds a conflict. This will help prevent accidental collisions which would manifest as strange errors.
const deps = { a: 1 };
const logicMiddleware = createLogicMiddleware(logic, deps);
const store = createStore(reducer, applyMiddleware(logicMiddleware));
logicMiddleware.addDeps({ b: 2 }); // now deps are { a: 1, b: 2 }
logicMiddleware.addDeps({ b: 2 }); // ok, override with same value
logicMiddleware.addDeps({ b: 3 }); // throws an error, cannot override
v0.11.6
v0.11.0
Removed an artificial delay (microtask) for the dispatch since it was no longer needed due to previous code restructuring. Originally the delay was added to ensure that dispatches occurred after the next calls, but this was refactored a while back and thus the artificial delay is no longer needed.
It is unlikely that this will be a breaking change for anyone but to be safe I bumped the version just in case.