mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
docs: fix rxResource example to return object from params function (#64327)
Previously, the example returned a plain value instead of an object,
causing destructuring in the `stream` function to fail. Updated to
`params: () => ({ userId: this.userId() })` for correctness.
fixes: #64313
Update adev/src/content/ecosystem/rxjs-interop/signals-interop.md
Co-authored-by: Matthieu Riegler <kyro38@gmail.com>
PR Close #64327
This commit is contained in:
committed by
Andrew Kushnir
parent
59c152833e
commit
d7f2ac3342
@@ -146,7 +146,7 @@ export class UserProfile {
|
||||
protected userId = input<string>();
|
||||
|
||||
private userResource = rxResource({
|
||||
params: () => this.userId(),
|
||||
params: () => ({ userId: this.userId() }),
|
||||
|
||||
// The `stream` property expects a factory function that returns
|
||||
// a data stream as an RxJS Observable.
|
||||
|
||||
Reference in New Issue
Block a user