MCPcopy Index your code
hub / github.com/RubyLouvre/anu / createMergedResultFunction

Function createMergedResultFunction

test/react.js:964–978  ·  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

962 * @private
963 */
964function createMergedResultFunction(one, two) {
965 return function mergedResult() {
966 var a = one.apply(this, arguments);
967 var b = two.apply(this, arguments);
968 if (a == null) {
969 return b;
970 } else if (b == null) {
971 return a;
972 }
973 var c = {};
974 mergeIntoWithNoDuplicateKeys(c, a);
975 mergeIntoWithNoDuplicateKeys(c, b);
976 return c;
977 };
978}
979
980/**
981 * 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