Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return ops$ => {
const sharedOps$ = share(ops$);
const subscriptionResults$ = pipe(
sharedOps$,
filter(isSubscriptionOperation),
mergeMap(operation => {
const { key } = operation;
const teardown$ = pipe(
sharedOps$,
filter(op => op.operationName === 'teardown' && op.key === key)
);
return pipe(
createSubscriptionSource(operation),
takeUntil(teardown$)
);
})
);
const forward$ = pipe(
sharedOps$,
filter(op => !isSubscriptionOperation(op)),
return ops$ => {
const sharedOps$ = share(ops$);
const fetchResults$ = pipe(
sharedOps$,
filter(isOperationFetchable),
mergeMap(operation => {
const { key } = operation;
const teardown$ = pipe(
sharedOps$,
filter(op => op.operationName === 'teardown' && op.key === key)
);
return pipe(
createFetchSource(operation),
takeUntil(teardown$)
);
})
);
const forward$ = pipe(
sharedOps$,
filter(op => !isOperationFetchable(op)),