@geeeger/callback-provider
v2.0.7
Published
管理回调
Downloads
2
Readme
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);
});
});