I’m using the NgRx Store and want to use the rxMethods
at the ngOninit
.
I follow the guideline of the NgRX Store for rxMethods
. The sample is quite close what I’m looking for. But I have no clue how to adapt the given code.
I would like to have
<code>fetchAllAgain=signal<boolean>(false);
ngOnInit():void{
loadAllBooksByChange(fetchAllAgain);
}
</code>
<code>fetchAllAgain=signal<boolean>(false);
ngOnInit():void{
loadAllBooksByChange(fetchAllAgain);
}
</code>
fetchAllAgain=signal<boolean>(false);
ngOnInit():void{
loadAllBooksByChange(fetchAllAgain);
}
The value should be changed on the UI – for the sake of simplicity I leave it with a simple init.
And I would like to run the method loadAllBooks
as soon as fetchAllAgain
will change to true
.
<code>loadAllBooksByChange=rxMethod<void>
pipe(filter(fetchAllAgain),
exhausMap(() => {
.....
</code>
<code>loadAllBooksByChange=rxMethod<void>
pipe(filter(fetchAllAgain),
exhausMap(() => {
.....
</code>
loadAllBooksByChange=rxMethod<void>
pipe(filter(fetchAllAgain),
exhausMap(() => {
.....
I’m not sure about
- if the
signal
fetchAllAgain
should be queried in therxMethod
or outside. If outside then I only have the idea to implement witheffect
- I’m not clear how to query the filter and than set the response.