mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
store refactoring
This commit is contained in:
@@ -10,10 +10,13 @@ import { INotification, RPC, Services, Store } from "./store";
|
||||
export interface Env extends WEnv {
|
||||
services: Services;
|
||||
|
||||
// helpers
|
||||
dispatch(action: string, param?: any): void;
|
||||
// commands
|
||||
activateMenuItem(menuId: number): void;
|
||||
addNotification(notif: Partial<INotification>): number;
|
||||
closeNotification(id: number);
|
||||
closeNotification(id: number): void;
|
||||
toggleHomeMenu(): void;
|
||||
|
||||
// helpers
|
||||
rpc: RPC;
|
||||
|
||||
// configuration
|
||||
@@ -33,11 +36,16 @@ export function makeEnv(store: Store, templates: string): Env {
|
||||
const env: Env = {
|
||||
qweb,
|
||||
getID: idGenerator(),
|
||||
|
||||
services: store.services,
|
||||
dispatch: store.dispatch.bind(store),
|
||||
|
||||
activateMenuItem: store.activateMenuItem.bind(store),
|
||||
addNotification: store.addNotification.bind(store),
|
||||
closeNotification: store.closeNotification.bind(store),
|
||||
toggleHomeMenu: store.toggleHomeMenu.bind(store),
|
||||
|
||||
rpc: store.rpc.bind(store),
|
||||
|
||||
debug: false,
|
||||
isMobile: window.innerWidth <= 768
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user