How to use the san.nextTick function in san

To help you get started, we’ve selected a few san examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baidu / san-store / test / connect.createConnector.spec.js View on Github external
san.nextTick(() => {
            let dts = wrap.getElementsByTagName('dt');
            let dds = wrap.getElementsByTagName('dd');
            expect(dts.length).toBe(2);
            expect(dds.length).toBe(2);

            expect(dds[0].title).toBe('errorrik@gmail.com');
            expect(dds[1].title).toBe('errorrik@gmail.com');

            myComponent2.data.push('person.emails', 'erik@erik.com');
            san.nextTick(() => {
                let dts = wrap.getElementsByTagName('dt');
                let dds = wrap.getElementsByTagName('dd');
                expect(dts.length).toBe(2);
                expect(dds.length).toBe(3);

                expect(dds[0].title).toBe('errorrik@gmail.com');
                expect(dds[1].title).toBe('errorrik@gmail.com');
                expect(dds[2].title).toBe('erik@erik.com');

                myComponent1.dispose();
                myComponent2.dispose();
                document.body.removeChild(wrap);
                done();
            });

        });
github baidu / san-store / test / connect.san.spec.js View on Github external
san.nextTick(() => {
            let dts = wrap.getElementsByTagName('dt');
            let dds = wrap.getElementsByTagName('dd');
            expect(dts.length).toBe(2);
            expect(dds.length).toBe(6);

            expect(dds[0].title).toBe('erik168@163.com');
            expect(dds[1].title).toBe('errorrik@gmail.com');
            expect(dds[2].title).toBe('xxx@xxx.com');
            expect(dds[3].title).toBe('erik168@163.com');
            expect(dds[4].title).toBe('errorrik@gmail.com');
            expect(dds[5].title).toBe('xxx@xxx.com');

            myComponent2.data.push('emails', 'erik@erik.com');
            san.nextTick(() => {
                let dts = wrap.getElementsByTagName('dt');
                let dds = wrap.getElementsByTagName('dd');
                expect(dts.length).toBe(2);
                expect(dds.length).toBe(7);

                expect(dds[0].title).toBe('erik168@163.com');
                expect(dds[1].title).toBe('errorrik@gmail.com');
                expect(dds[2].title).toBe('xxx@xxx.com');
                expect(dds[3].title).toBe('erik168@163.com');
                expect(dds[4].title).toBe('errorrik@gmail.com');
                expect(dds[5].title).toBe('xxx@xxx.com');
                expect(dds[6].title).toBe('erik@erik.com');

                myComponent1.dispose();
                myComponent2.dispose();
                document.body.removeChild(wrap);
github baidu / san / example / todos-amd / src / todo / List-perf.js View on Github external
rmTodo: function (index) {
            var todos = this.data.get('todos');
            service.rmTodo(todos[index].id);

            var now = new Date();
            this.data.removeAt('todos', index);
            san.nextTick(function () {
                alert('List item delete: ' + ((new Date) - now));
            });
        }
    });
github ecomfe / san-mui / src / TreeView / TreeViewItem.js View on Github external
this.watch('treeData.treeData', value => {
            san.nextTick(function () {
                this.updateSelfCheckboxStateFromChilds();
            }, this);
        });
github ecomfe / san-xui / src / sanx.js View on Github external
export function nextTick(fn, thisArg) {
    return san.nextTick(fn, thisArg);
}
github baidu / san-devtool / src / panel / components / TreeView / TreeViewItem.js View on Github external
this.watch('treeData.treeData', value => {
            san.nextTick(function () {
                this.updateSelfCheckboxStateFromChilds();
            }, this);
        });