UNPKG

react-kiwi-dropdown

Version:

A minimal, easy-to-use and highly adjustable dropdown component made with ReactJS.

20 lines 479 B
let nextHandle = 1; const tasksByHandle = {}; function runIfPresent(handle) { const cb = tasksByHandle[handle]; if (cb) { cb(); } } export const Immediate = { setImmediate(cb) { const handle = nextHandle++; tasksByHandle[handle] = cb; Promise.resolve().then(() => runIfPresent(handle)); return handle; }, clearImmediate(handle) { delete tasksByHandle[handle]; }, }; //# sourceMappingURL=Immediate.js.map