You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.
action creators allow for omitting payload which can easily lead to runtime errors :(
from the example:
constadd=createAction<number>('add');// payload of type numberadd(10)// OKadd()// should not compileadd(undefined)// should not compilehandleAction(add,(state,{ payload })=>{// payload infered as number (not number | undefined)state.counter+=payload;// state.counter will be NaN 💀}),
Tested with typescript 3.4.5 and all strict rules enabled.
The text was updated successfully, but these errors were encountered:
mixvar
pushed a commit
to mixvar/redux-ts-utils
that referenced
this issue
May 21, 2019
action creators allow for omitting payload which can easily lead to runtime errors :(
from the example:
Tested with typescript 3.4.5 and all strict rules enabled.
The text was updated successfully, but these errors were encountered: