Create a factory for actions using createAction not working #3361
-
I want to create a function that returns an action function using the
I want to do this to simplify the creation of actions in my project. I get the following error:
Any ideas of what I'm doing wrong? I'm using NgRx version 13. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I am not aware of a way to type this such that a generic declared in However, if you take in a "props config" as a parameter, then you could make a factory:
|
Beta Was this translation helpful? Give feedback.
T
must be guaranteed to satisfy the constraintNotAllowedInPropsCheck
. This type guard excludes objects with atype
property, empty objects, and primitives.I am not aware of a way to type this such that a generic declared in
actionFactory
is guaranteed to pass this check. It only works with concrete object types.However, if you take in a "props config" as a parameter, then you could make a factory: