MCPcopy Create free account
hub / github.com/ctrlplusb/react-injectables / uniqBy

Function uniqBy

src/utils.js:52–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50
51// :: a -> [b]
52export const uniqBy = x => y => {
53 const checked = new Set();
54 const result = [];
55
56 y.forEach(a => {
57 const prop = a[x];
58 if (!checked.has(prop)) {
59 checked.add(prop);
60 result.push(a);
61 }
62 });
63
64 return result;
65};
66
67/**
68 * :: [a] -> [a] -> boolean

Callers 1

runInjectionsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected