client/general: replace direct API with models

This commit is contained in:
rr-
2016-06-19 19:16:40 +02:00
parent 5f4b67a2bc
commit eb09677bf8
33 changed files with 1025 additions and 572 deletions

View File

@ -28,22 +28,6 @@ class PageController {
showError(message) {
this._view.showError(message);
}
static createHistoryCacheProxy(routerCtx, requestPage) {
return page => {
if (routerCtx.state.response) {
return new Promise((resolve, reject) => {
resolve(routerCtx.state.response);
});
}
const promise = requestPage(page);
promise.then(response => {
routerCtx.state.response = response;
routerCtx.save();
});
return promise;
};
}
}
module.exports = PageController;