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
When event created by prepend directly in cases object, it shows errors in any cases, but everything works ok when unit or cases object created in separated variable
This is a TypeScript type inference nuance, cases in this case (No puns intended) is something like Record<string, Event<T>>. This issue can be easily solved by adding as const like this:
When event created by prepend directly in cases object, it shows errors in any cases, but everything works ok when unit or cases object created in separated variable
This not works:
This works:
Link to TS repl
The text was updated successfully, but these errors were encountered: