Skip to content

Instantly share code, notes, and snippets.

@Akiyamka
Created June 28, 2018 14:35
Show Gist options
  • Select an option

  • Save Akiyamka/98ee27a00507883870ac3bff31ba1c8f to your computer and use it in GitHub Desktop.

Select an option

Save Akiyamka/98ee27a00507883870ac3bff31ba1c8f to your computer and use it in GitHub Desktop.
activate() {
this.pipeline = {
A_requestModel: () => {
this.params.loading = true;
return this.get(newRequest(this.params));
},
B_requestDataOnce: () => {
const state = this.store.getState();
this.constants = state.constants;
this.currentUser = state.currentUser;
return Promise.resolve();
},
C_dumpFromStore: () => {
const state = this.store.getState();
this.model = state.allApprovals;
this.model.data = this.model.data.map(a => this.convertStatus(a));
return Promise.resolve();
},
D_end: () => {
this.loadsetLastSelectRow(this.model.data, this.lastSelectRow);
this.params.loading = false;
},
};
}
fetchData() {
this.startPipeline(this.pipeline);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment