2.0.7 • Published 3 years ago

@geeeger/callback-provider v2.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

data

callback管理工具

Usage

import CallbackProvider from '@geeeger/callback-provider';

describe('test', () => {
    test('should pass', () => {
        const c = new CallbackProvider(window);
        function d() {
            return new Promise((res) => {
                c.pushCallbackStack('x', (data) => {
                    res(data);
                });
                c.listen('x');
            });
        }

        expect(d()).resolves.toEqual(1);
        c.run('x', 1);
    });
});
2.0.7

3 years ago

2.0.4

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago