ref: reorganize exports into core/extras

This commit is contained in:
Géry Debongnie
2019-03-27 15:18:25 +01:00
parent 2758269139
commit e53287b52e
3 changed files with 14 additions and 7 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { TodoItem } from "./TodoItem.js";
const { connect, Component } = odoo.core;
const { Component } = odoo.core;
const { connect } = odoo.extras;
const ENTER_KEY = 13;
+1 -1
View File
@@ -66,7 +66,7 @@ export function makeStore() {
);
const nextId = Math.max(0, ...todos.map(t => t.id || 0)) + 1;
const state = { todos, nextId };
const store = new odoo.core.Store({ state, actions, mutations });
const store = new odoo.extras.Store({ state, actions, mutations });
store.on("update", null, () => {
const state = JSON.stringify(store.state.todos);
window.localStorage.setItem(LOCALSTORAGE_KEY, state);
+11 -5
View File
@@ -1,14 +1,20 @@
import { QWeb } from "./qweb";
import { EventBus } from "./event_bus";
import { Component, PureComponent } from "./component";
import { Store, connect } from "./store";
import { EventBus } from "./event_bus";
import { QWeb } from "./qweb";
import { Registry } from "./registry";
import { connect, Store } from "./store";
import * as utils from "./utils";
export const core = {
QWeb,
EventBus,
Component,
PureComponent,
Store,
connect,
utils
};
export const extras = {
Store,
connect,
Registry
};