source: node_modules/ramda-adjunct/lib/resolveP.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 1.1 KB
RevLine 
[d24f17c]1"use strict";
2
3exports.__esModule = true;
4exports["default"] = void 0;
5var _ramda = require("ramda");
6/* eslint-disable max-len */
7/**
8 * Composable shortcut for `Promise.resolve`.
9 *
10 * Returns a Promise object that is resolved with the given value.
11 * If the value is a thenable (i.e. has a "then" method), the returned promise will
12 * "follow" that thenable, adopting its eventual state.
13 *
14 * @func resolveP
15 * @memberOf RA
16 * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
17 * @category Function
18 * @sig a -> Promise a
19 * @param {*} [value=undefined] Argument to be resolved by this Promise. Can also be a Promise or a thenable to resolve
20 * @return {Promise} A Promise that is resolved with the given value, or the promise passed as value, if the value was a promise object
21 * @see {@link RA.rejectP|rejectP}
22 * @example
23 *
24 * RA.resolveP(); //=> Promise(undefined)
25 * RA.resolveP('a'); //=> Promise('a')
26 * RA.resolveP([1, 2, 3]); //=> Promise([1, 2, 3])
27 */
28/* eslint-enable max-len */
29var resolveP = (0, _ramda.bind)(Promise.resolve, Promise);
30var _default = resolveP;
31exports["default"] = _default;
Note: See TracBrowser for help on using the repository browser.