Open
Description
Which @ngrx/* package(s) are relevant/related to the feature request?
operators
Information
The tapResponse
signature that accepts a sequence of callbacks:
tapResponse<T>(
next: (value: T) => void,
error: (error: unknown) => void,
complete?: () => void
)
will be deprecated in v20 in favor of another tapResponse
signature that accepts the observer object:
tapResponse<T>(observer: {
next: (value: T) => void;
error: (error: unknown) => void;
complete?: () => void;
finalize?: () => void;
})
Provide a schematic that migrates from deprecated to the tapResponse
signature with the observer object. It should support the following cases:
- The most common:
// from:
tapResponse(() => next, () => error)
// to:
tapResponse({ next: () => next, error: () => error })
// from:
tapResponse(() => next, () => error, () => complete)
// to:
tapResponse({ next: () => next, error: () => error, complete: () => complete })
- When the
tapResponse
operator is aliased:
import { tapResponse as myTapResponse } from '@ngrx/operators';
// from:
myTapResponse(() => next, () => error)
// to:
myTapResponse({ next: () => next, error: () => error })
// from:
myTapResponse(() => next, () => error, () => complete)
// to:
myTapResponse({ next: () => next, error: () => error, complete: () => complete })
- When namespace import is used:
import * as operators from '@ngrx/operators';
// from:
operators.tapResponse(() => next, () => error)
// to:
operators.tapResponse({ next: () => next, error: () => error })
// from:
operators.tapResponse(() => next, () => error, () => complete)
// to:
operators.tapResponse({ next: () => next, error: () => error, complete: () => complete })
Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
- Yes
- No