mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] component: refactor rendering pipeline
This commit introduces a brand new rendering system based on a fiber class and a scheduler. closes #330
This commit is contained in:
committed by
Géry Debongnie
parent
2bed1cfbd1
commit
9c5cad15c1
@@ -51,8 +51,8 @@ describe("connecting a component to store", () => {
|
||||
const state = { a: 1, b: 2 };
|
||||
const actions = {
|
||||
doSomething({ state }) {
|
||||
state.a = 2;
|
||||
state.b = 3;
|
||||
state.a = 2;
|
||||
state.b = 3;
|
||||
}
|
||||
};
|
||||
const store = new Store({ state, actions });
|
||||
@@ -63,8 +63,8 @@ describe("connecting a component to store", () => {
|
||||
<span t-esc="a.value"/>
|
||||
<span t-esc="b.value"/>
|
||||
</div>`;
|
||||
a = useStore(state => ({value: state.a}));
|
||||
b = useStore(state => ({value: state.b}));
|
||||
a = useStore(state => ({ value: state.a }));
|
||||
b = useStore(state => ({ value: state.b }));
|
||||
}
|
||||
App.prototype.__render = jest.fn(App.prototype.__render);
|
||||
|
||||
@@ -79,7 +79,7 @@ describe("connecting a component to store", () => {
|
||||
await nextTick();
|
||||
expect(fixture.innerHTML).toBe("<div><span>2</span><span>3</span></div>");
|
||||
expect(App.prototype.__render).toBeCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
test("useStore: do not re-render if not changed", async () => {
|
||||
let nextId = 1;
|
||||
|
||||
Reference in New Issue
Block a user