main
Last change
on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
807 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | exports.__esModule = true;
|
---|
4 | exports["default"] = void 0;
|
---|
5 | var _ramda = require("ramda");
|
---|
6 | /**
|
---|
7 | * Composable shortcut for `Promise.reject`.
|
---|
8 | *
|
---|
9 | * Returns a Promise object that is rejected with the given reason.
|
---|
10 | *
|
---|
11 | * @func rejectP
|
---|
12 | * @memberOf RA
|
---|
13 | * @since {@link https://char0n.github.io/ramda-adjunct/1.16.0|v1.16.0}
|
---|
14 | * @category Function
|
---|
15 | * @sig a -> Promise a
|
---|
16 | * @param {*} [reason=undefined] Reason why this Promise rejected
|
---|
17 | * @return {Promise} A Promise that is rejected with the given reason
|
---|
18 | * @see {@link RA.resolveP|resolveP}
|
---|
19 | * @example
|
---|
20 | *
|
---|
21 | * RA.rejectP(); //=> Promise(undefined)
|
---|
22 | * RA.rejectP('a'); //=> Promise('a')
|
---|
23 | * RA.rejectP([1, 2, 3]); //=> Promise([1, 2, 3])
|
---|
24 | */
|
---|
25 | var rejectP = (0, _ramda.bind)(Promise.reject, Promise);
|
---|
26 | var _default = rejectP;
|
---|
27 | exports["default"] = _default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.