refactoring, work on environment

This commit is contained in:
Géry Debongnie
2019-01-23 14:28:41 +01:00
parent 08938d2334
commit 76fedae5a9
18 changed files with 138 additions and 63 deletions
+25 -8
View File
@@ -1,12 +1,29 @@
import QWeb from "./core/qweb_vdom";
import { WEnv } from "./core/widget";
import actions, { Action } from "./services/actions";
import ActionManager from "./services/action_manager";
import Ajax from "./services/ajax";
import Router from "./services/router";
import actions from "./services/actions";
import { Env } from "./types";
const env: Env = {
qweb: new QWeb(),
router: new Router(),
services: { actions }
};
export interface Env extends WEnv {
actionManager: ActionManager;
actions: Action[];
ajax: Ajax;
router: Router;
}
export function makeEnvironment(): Env {
const qweb = new QWeb();
const router = new Router();
const ajax = new Ajax();
const actionManager = new ActionManager();
return {
qweb,
ajax,
router,
actionManager,
actions
};
}
export default env;