UNPKG

@n1ru4l/in-memory-live-query-store

Version:

[![npm version](https://img.shields.io/npm/v/@n1ru4l/in-memory-live-query-store.svg)](https://www.npmjs.com/package/@n1ru4l/in-memory-live-query-store) [![npm downloads](https://img.shields.io/npm/dm/@n1ru4l/in-memory-live-query-store.svg)](https://www.np

10 lines (9 loc) 324 B
// 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); } };