MCPcopy Create free account
hub / github.com/Lobos/react-ui / createMergedResultFunction

Function createMergedResultFunction

docs/lib/react.js:4922–4936  ·  view source on GitHub ↗

* Creates a function that invokes two functions and merges their return values. * * @param {function} one Function to invoke first. * @param {function} two Function to invoke second. * @return {function} Function that invokes the two argument functions. * @private

(one, two)

Source from the content-addressed store, hash-verified

4920 * @private
4921 */
4922function createMergedResultFunction(one, two) {
4923 return function mergedResult() {
4924 var a = one.apply(this, arguments);
4925 var b = two.apply(this, arguments);
4926 if (a == null) {
4927 return b;
4928 } else if (b == null) {
4929 return a;
4930 }
4931 var c = {};
4932 mergeIntoWithNoDuplicateKeys(c, a);
4933 mergeIntoWithNoDuplicateKeys(c, b);
4934 return c;
4935 };
4936}
4937
4938/**
4939 * Creates a function that invokes two functions and ignores their return vales.

Callers 2

react.jsFile · 0.85
mixSpecIntoComponentFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…