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

14 lines (13 loc) 447 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runWith = void 0; // 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. const runWith = (input, callback) => { if (input instanceof Promise) { input.then(callback, () => undefined); } else { callback(input); } }; exports.runWith = runWith;