feat(Dispatcher): Introduce DispatcherPayloadMeta #62

Open
wants to merge 6 commits into
from

Projects

None yet

1 participant

@azu
Member
azu commented Nov 20, 2016 edited

Changes

  • Add DispatcherPayloadMeta.js
  • Dispatcher User dispatch payload with meta.
  • Each system payload(e.g. ErrorPayload) to be Payload class.
    • WillExecutePayload class
    • DidExecutePayload class
    • CompleteExecutePayload class

It contains breaking change to be stable ecosystem.

refs #61

@azu azu feat(Dispatcher): Introduce DispatcherPayloadMeta
- Add DispatcherPayloadMeta.js
- Dispatcher User dispatch `payload` and `meta`.

refs #61
d123fbf
@azu azu added the Breaking label Nov 20, 2016
@azu azu fix(flow): fix flow definition
ad3f3e2
* }
* }):
+ * @deprecated
*/
onError(handler) {
@azu
azu Nov 20, 2016 Member

Store#onError will be deprecated

+ onDispatch(handler: (payload: DispatcherPayload, meta: DispatcherPayloadMeta) => mixed): Function;
+ onDidExecuteEachUseCase(handler: (payload: DispatcherPayload, meta: DispatcherPayloadMeta) => mixed): Function;
+ onCompleteExecuteEachUseCase(handler: (payload: DispatcherPayload, meta: DispatcherPayloadMeta) => mixed): Function;
+ onErrorDispatch(handler: (payload: DispatcherPayload, meta: DispatcherPayloadMeta) => mixed): Function;
@azu
azu Nov 20, 2016 Member

Apply unified arguments to Context#on* methods.

We will improve this maybe by preparing each Payload class

  • WillExecutePayload class
  • DidExecutePayload class
  • CompleteExecutePayload class
azu added some commits Nov 20, 2016
@azu azu test(Context): add test to call onCompleteEachUseCase 8682a20
@azu azu refactor(payload): introduce Payload class
- DispatcherPayloadMeta has `isTrusted` property that is true if generated by almin
- Each system payload object to be Payload class
f14c33d
@azu azu docs(payload): add description Payload class
ca4ab78
@azu azu test(Context): add Payload instance testing
916f666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment