lift.js 624 B

1234567891011121314151617181920
  1. import { isFunction } from './isFunction';
  2. export function hasLift(source) {
  3. return isFunction(source === null || source === void 0 ? void 0 : source.lift);
  4. }
  5. export function operate(init) {
  6. return (source) => {
  7. if (hasLift(source)) {
  8. return source.lift(function (liftedSource) {
  9. try {
  10. return init(liftedSource, this);
  11. }
  12. catch (err) {
  13. this.error(err);
  14. }
  15. });
  16. }
  17. throw new TypeError('Unable to lift unknown Observable type');
  18. };
  19. }
  20. //# sourceMappingURL=lift.js.map