More specific definitions#41
Conversation
7fe5e6c to
26ad57e
Compare
26ad57e to
e459cf9
Compare
| fulfill: RoutineActionCreator<any>; | ||
| export interface RoutineActionCreators<TActionCreator> { | ||
| trigger: TActionCreator; | ||
| request: ActionFunctionAny<Action<any>>; |
There was a problem hiding this comment.
To support payload / meta creators that may be passed as createRoutine('TYPE', payloadCreator, metaCreator) in non-trigger actions. RoutineActionCreator limited metaCreator to be only (payload?: any) while it can be (...args: any[]) to handle myRoutine(payload, some, thing)
| failure: RoutineActionCreator<any>; | ||
| fulfill: RoutineActionCreator<any>; | ||
| export interface RoutineActionCreators<TActionCreator> { | ||
| trigger: TActionCreator; |
There was a problem hiding this comment.
The trigger action creator is strongly-typed if called as myRoutine(typedPayload), so it should be consistent with myRoutine.trigger(typedPayload)
| export function createRoutine( | ||
| typePrefix: string | ||
| ): Routine<ActionFunction0<RoutineAction<void>>>; | ||
| ): Routine<ActionFunctionAny<Action<any>>>; |
There was a problem hiding this comment.
Since createRoutine calls createAction, a createAction implementation (not definition until DefinitelyTyped/DefinitelyTyped#25286) supports mySimpleAction(), mySimpleAction(payload), and mySimpleAction(payload, nothing, interesting, unless, payloadIsError) for const mySimpleAction = createAction('SIMPLE_ACTION'), thus createRoutine() returning a trigger should behave the same
|
Is everything ready for merge? |
|
@afitiskin it is now, please check the last commit |
This reverts commit 22c0906.
| props: P | ||
| } | ||
|
|
||
| export function bindRoutineToReduxForm<Payload extends ReduxFormPayload<FormData, P>>( |
There was a problem hiding this comment.
FormData here refers to global FormData object which is totally unrelated to redux-form's type.
There was a problem hiding this comment.
True, somehow I've lost part of the PR - #45
No description provided.