_xtap.js 516 B

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