Skip to content

feat(almin): Context#transaction#226

Merged
azu merged 10 commits intomasterfrom
transaction-of-usecase
Jul 11, 2017
Merged

feat(almin): Context#transaction#226
azu merged 10 commits intomasterfrom
transaction-of-usecase

Conversation

@azu
Copy link
Copy Markdown
Member

@azu azu commented Jul 9, 2017

It allow to execute multiple UseCases in a transaction.
It aim to reduce unnessary updating of view/store.

image

Strict mode

  • This feature is enabled in strict mode
  • Strict mode check that updating store/state in Store#receivePayload
    • It means that show warning if update store outside of receivePayload

fix #219
fix #201

* Initialized Payload
* This is exported for an unit testing.
* DO NOT USE THIS in your application.
*/
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.

Move to payload/ directory.
But, it is not exports from index.js by design.

*
* It is similar reason to why use Dispatcher insteadof EventEmitter.
*/
export type Commitment = [Payload, DispatcherPayloadMeta]
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.

Add Commitment type that is tuple of [Payload, DispatcherPayloadMeta]


return new MockStore();
};
describe("Context#transaction", () => {
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.

Tests.

We need more pattern...

@azu azu merged commit e013d84 into master Jul 11, 2017
@azu azu deleted the transaction-of-usecase branch July 11, 2017 13:11
@azu azu mentioned this pull request Jul 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

almin: Transaction of UseCase Store: strict mode

1 participant