@zendesk/laika
Version:
Test, mock, intercept and modify Apollo Client's operations — in both browser and unit tests!
20 lines • 756 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapObservable = void 0;
const core_1 = require("@apollo/client/core");
const mapObservable = (input, mapFn) => new core_1.Observable((observer) => input.subscribe({
next: (value) => {
var _a;
(_a = observer.next) === null || _a === void 0 ? void 0 : _a.call(observer, mapFn(value));
},
error: (error) => {
var _a;
(_a = observer.error) === null || _a === void 0 ? void 0 : _a.call(observer, error);
},
complete: () => {
var _a;
(_a = observer.complete) === null || _a === void 0 ? void 0 : _a.call(observer);
},
}));
exports.mapObservable = mapObservable;
//# sourceMappingURL=observableUtils.js.map