Type-safe action creator utilities
ActionCreator
from being a type
alias to interface
with help of https://github.com/microsoft/TypeScript/issues/4260. Therefore, the oldest supported TypeScript version is now 3.2
.params
and result
of type void
in Async Action Creators. Requires TypeScript 2.8.const async = actionCreator.async<void, {bar: string}>('ASYNC');
// skipping argument
const started = async.started();
// skipping `params`
const done = async.done({result: {bar: 'bar'}});
const async = actionCreator.async<{foo: string}, void>('ASYNC');
// skipping `result`
const done = async.done({params: {foo: 'foo'}});
toString()
method to action creators returning its type (https://github.com/aikoven/typescript-fsa/pull/33).
This is useful for redux-saga
users where you can now useyield take(myActionCreator)
instead of
yield take(myActionCreator.type)
Action.meta
to be unrestricted index signature. (https://github.com/aikoven/typescript-fsa/issues/26)Revert breaking change introduced in 2.1.0
Renamed package to typescript-fsa
and decoupled from Redux (https://github.com/aikoven/typescript-fsa/issues/12).