mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-11 14:14:36 +08:00
DISABLE_THIRD_PARTY_CHECK=new npm module causes package-lock change We can get rid of a custom script and use ESLint for these rules. Additionally this means editors will highlight the issue in the editor. Change-Id: I552b52e7f07b4e7430b3f685dbc3b5fad36ffff2 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2052167 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
import _curry2 from './internal/_curry2.js';
|
|
import _assertPromise from './internal/_assertPromise.js';
|
|
|
|
/**
|
|
* Returns the result of applying the onSuccess function to the value inside
|
|
* a successfully resolved promise. This is useful for working with promises
|
|
* inside function compositions.
|
|
*
|
|
* @func
|
|
* @memberOf R
|
|
* @category Function
|
|
* @sig (a -> b) -> (Promise e a) -> (Promise e b)
|
|
* @sig (a -> (Promise e b)) -> (Promise e a) -> (Promise e b)
|
|
* @param {Function} onSuccess The function to apply. Can return a value or a promise of a value.
|
|
* @param {Promise} p
|
|
* @return {Promise} The result of calling `p.then(onSuccess)`
|
|
* @see R.otherwise
|
|
* @example
|
|
*
|
|
* var makeQuery = (email) => ({ query: { email }});
|
|
*
|
|
* //getMemberName :: String -> Promise ({firstName, lastName})
|
|
* var getMemberName = R.pipe(
|
|
* makeQuery,
|
|
* fetchMember,
|
|
* R.then(R.pick(['firstName', 'lastName']))
|
|
* );
|
|
*/
|
|
var then = /*#__PURE__*/_curry2(function then(f, p) {
|
|
_assertPromise('then', p);
|
|
|
|
return p.then(f);
|
|
});
|
|
export default then; |