mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
ref: reorganize exports into core/extras
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import { TodoItem } from "./TodoItem.js";
|
import { TodoItem } from "./TodoItem.js";
|
||||||
|
|
||||||
const { connect, Component } = odoo.core;
|
const { Component } = odoo.core;
|
||||||
|
const { connect } = odoo.extras;
|
||||||
|
|
||||||
const ENTER_KEY = 13;
|
const ENTER_KEY = 13;
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export function makeStore() {
|
|||||||
);
|
);
|
||||||
const nextId = Math.max(0, ...todos.map(t => t.id || 0)) + 1;
|
const nextId = Math.max(0, ...todos.map(t => t.id || 0)) + 1;
|
||||||
const state = { todos, nextId };
|
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, () => {
|
store.on("update", null, () => {
|
||||||
const state = JSON.stringify(store.state.todos);
|
const state = JSON.stringify(store.state.todos);
|
||||||
window.localStorage.setItem(LOCALSTORAGE_KEY, state);
|
window.localStorage.setItem(LOCALSTORAGE_KEY, state);
|
||||||
|
|||||||
+11
-5
@@ -1,14 +1,20 @@
|
|||||||
import { QWeb } from "./qweb";
|
|
||||||
import { EventBus } from "./event_bus";
|
|
||||||
import { Component, PureComponent } from "./component";
|
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";
|
import * as utils from "./utils";
|
||||||
|
|
||||||
export const core = {
|
export const core = {
|
||||||
QWeb,
|
QWeb,
|
||||||
EventBus,
|
EventBus,
|
||||||
Component,
|
Component,
|
||||||
PureComponent,
|
PureComponent,
|
||||||
Store,
|
|
||||||
connect,
|
|
||||||
utils
|
utils
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const extras = {
|
||||||
|
Store,
|
||||||
|
connect,
|
||||||
|
Registry
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user