@n1ru4l/in-memory-live-query-store
Version:
[](https://www.npmjs.com/package/@n1ru4l/in-memory-live-query-store) [](https://www.np
10 lines (9 loc) • 324 B
JavaScript
// invokes the callback with the resolved or sync input. Handy when you don't know whether the input is a Promise or the actual value you want.
export const runWith = (input, callback) => {
if (input instanceof Promise) {
input.then(callback, () => undefined);
}
else {
callback(input);
}
};