Skip to content

feat(almin): add StoreChangedPayload#239

Merged
azu merged 9 commits intomasterfrom
store-changed-payload
Jul 15, 2017
Merged

feat(almin): add StoreChangedPayload#239
azu merged 9 commits intomasterfrom
store-changed-payload

Conversation

@azu
Copy link
Copy Markdown
Member

@azu azu commented Jul 15, 2017

Notable Changes

  • Renaming: context.on* to context.events.on* without context.onChange
    • context.on* is deprecated. These will be removed in the furture.
    • Context.onChange is still on Context prototype.
    • Because, it is not life-cycle events and it is optimized for updating UI.
  • Migration scripts: https://github.com/almin/migration-tools#migrate-012-to-013
context.onWillExecuteEachUseCase((payload, meta) => {});
context.onDispatch((payload, meta) => {});
context.onDidExecuteEachUseCase((payload, meta) => {});
context.onCompleteEachUseCase((payload, meta) => {});
context.onErrorDispatch((payload, meta) => {});

to

context.events.onWillExecuteEachUseCase((payload, meta) => {});
context.events.onDispatch((payload, meta) => {});
context.events.onDidExecuteEachUseCase((payload, meta) => {});
context.events.onCompleteEachUseCase((payload, meta) => {});
context.events.onErrorDispatch((payload, meta) => {});

Add StoreChangedPayload that is created by Store#onChange.
Currently, almin has StoreGroup#onChange((stores) => {}, but this callback shape is difference with other payload.
Now, almin introduce the same format payload for StoreGroup.

The implementation match following figure.

image

All events pass through LifeCycleEventHub.

Add StoreChangedPayload that is created by Store#onChangeDetails.
Currently, almin has `StoreGroup#onChange((stores) => {}`, but this callback shape is difference with other payload.
Now, almin introduce the same format payload for StoreGroup.
const payload = new StoreChangedPayload(store);
const meta = new DispatcherPayloadMetaImpl({
// this dispatch payload generated by this UseCase
useCase: undefined,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can improve this.

@azu azu mentioned this pull request Jul 15, 2017
@azu azu merged commit f68f834 into master Jul 15, 2017
@azu azu deleted the store-changed-payload branch July 15, 2017 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant