source: node_modules/ramda/es/internal/_xuniqBy.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 617 bytes
RevLine 
[d24f17c]1import _Set from "./_Set.js";
2import _xfBase from "./_xfBase.js";
3
4var XUniqBy =
5/*#__PURE__*/
6function () {
7 function XUniqBy(f, xf) {
8 this.xf = xf;
9 this.f = f;
10 this.set = new _Set();
11 }
12
13 XUniqBy.prototype['@@transducer/init'] = _xfBase.init;
14 XUniqBy.prototype['@@transducer/result'] = _xfBase.result;
15
16 XUniqBy.prototype['@@transducer/step'] = function (result, input) {
17 return this.set.add(this.f(input)) ? this.xf['@@transducer/step'](result, input) : result;
18 };
19
20 return XUniqBy;
21}();
22
23export default function _xuniqBy(f) {
24 return function (xf) {
25 return new XUniqBy(f, xf);
26 };
27}
Note: See TracBrowser for help on using the repository browser.