_xtakeWhile.js 618 B

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