New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking Change: feat(Dispatcher): Introduce DispatcherPayloadMeta #62

Merged
merged 14 commits into from Feb 16, 2017

Conversation

Projects
None yet
1 participant
@azu
Member

azu commented Nov 20, 2016

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

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

refs #61

@azu azu added the Breaking label Nov 20, 2016

* }
* }):
* @deprecated
*/
onError(handler) {

This comment has been minimized.

@azu

azu Nov 20, 2016

Member

Store#onError will be deprecated

@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;

This comment has been minimized.

@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

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

refactor(payload): introduce Payload class
- DispatcherPayloadMeta has `isTrusted` property that is true if generated by almin
- Each system payload object to be Payload class
// It means that `onDispatch` is called when dispatching user event.
if (ActionTypes[payload.type] === undefined) {
if (!meta.isTrusted) {

This comment has been minimized.

@azu

azu Jan 31, 2017

Member

Is meta.isStystemEvent better?

@azu

azu Jan 31, 2017

Member

Is meta.isStystemEvent better?

*/
this.name = this.displayName || this.constructor.name || defaultUseCaseName;
this.id = createNewID();

This comment has been minimized.

@azu

azu Feb 16, 2017

Member

Is id nessary?
We can use WeakMap insteadof it.

@azu

azu Feb 16, 2017

Member

Is id nessary?
We can use WeakMap insteadof it.

Show outdated Hide outdated src/UseCase.js
* @public
* @override
*/
dispatch(payload, meta) {

This comment has been minimized.

@azu

azu Feb 16, 2017

Member

UseCase always has own as meta.useCase.

@azu

azu Feb 16, 2017

Member

UseCase always has own as meta.useCase.

Show outdated Hide outdated src/DispatcherPayloadMeta.js
* @readonly
* @public
*/
this.parentDispatcher = parentDispatcher;

This comment has been minimized.

@azu

azu Feb 16, 2017

Member

to bethis.dispatcher, make simple?

@azu

azu Feb 16, 2017

Member

to bethis.dispatcher, make simple?

@azu azu changed the title from feat(Dispatcher): Introduce DispatcherPayloadMeta to Breaking Change: feat(Dispatcher): Introduce DispatcherPayloadMeta Feb 16, 2017

@azu azu merged commit b793d2a into master Feb 16, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@azu azu deleted the almin-meta branch Feb 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment