@geeeger/callback-provider
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

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);
    });
});

Readme

Keywords

Package Sidebar

Install

npm i @geeeger/callback-provider

Weekly Downloads

0

Version

2.0.7

License

ISC

Unpacked Size

4.14 kB

Total Files

4

Last publish

Collaborators

  • geeeger