2

I have the createAction function from ngrx.io Store... with that signature: https://v11.ngrx.io/api/store/createAction

createAction<T extends string, C extends Creator>(type: T, config?: C | { _as: "props"; }): ActionCreator<T>

and this:

createAction(type: T, config: ActionCreatorProps<P> & NotAllowedCheck<P>): ActionCreator<T, (props: P & NotAllowedCheck<P>) => P & TypedAction<T>>

Creator typpe itself has that signature:

type Creator<P extends any[] = any[], R extends object = object> = FunctionWithParametersType<P, R>;

I really have problems reading this, e.g what means config?: C | { _as: "props";} is it an optional config property with type C or object { _as: "props";} ? Can someone help me debunk one of those above syntaxes? And btw, the documentations are generally also written in the same language, is that right? so a doc about flutter would have its flutter signatures for methods, etc. right?

MMMM
  • 3,320
  • 8
  • 43
  • 80

0 Answers0