July 2018
Beginner
236 pages
5h 34m
English
We have already seen that the WorkflowStep has two action methods, load() and perform(), that handle the async operations of the step:
class WorkflowStep { workflow = null; @observable loadState = 'none'; // pending | completed | failed @observable operationState = 'none'; // pending | completed | failed async getLoadOperation() {} async getMainOperation() {} @action.bound async load() { doAsync( () => this.getLoadOperation(), state => (this.loadState = state), ); } @action.bound async perform() { doAsync( () => this.getMainOperation(), state => (this.operationState = state), ); }}
The load() action is invoked by CheckoutWorkflow as it loads each step of the workflow. perform() is a user invoked action ...
Read now
Unlock full access