Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Latest commit

 

History

History
38 lines (29 loc) · 1021 Bytes

redux-action-context.md

File metadata and controls

38 lines (29 loc) · 1021 Bytes

@ReduxActionContext

Marks a class as redux action context. This context is used by the @ReduxAction decorator to resolve the action type.

@ReduxActionContext({
  prefix: string;
})

Configuration Options

prefix

Sets the prefix that shall be used for all redux actions that will use this context. The prefix and the action type is concatenated to one string.

type string
mandatory yes
@ReduxActionContext({
  prefix: 'some-prefix/'
})
class SomeClass {                //  This will dispatch the following action:
                                 //
  @ReduxAction()                 //  {
  public someMethod(): string {  //    "type": "some-prefix/someMethod",
    return 'some-return-value';  //    "payload": "some-return-value"
  }                              //  }

}