_xmap.js 526 B

123456789101112131415161718192021222324252627
  1. import _xfBase from "./_xfBase.js";
  2. var XMap =
  3. /*#__PURE__*/
  4. function () {
  5. function XMap(f, xf) {
  6. this.xf = xf;
  7. this.f = f;
  8. }
  9. XMap.prototype['@@transducer/init'] = _xfBase.init;
  10. XMap.prototype['@@transducer/result'] = _xfBase.result;
  11. XMap.prototype['@@transducer/step'] = function (result, input) {
  12. return this.xf['@@transducer/step'](result, this.f(input));
  13. };
  14. return XMap;
  15. }();
  16. var _xmap = function _xmap(f) {
  17. return function (xf) {
  18. return new XMap(f, xf);
  19. };
  20. };
  21. export default _xmap;