Angular - react to changes in rxResource()

Discussão em 'Angular' iniciado por Nevyan Dimitrov Neykov, Dezembro 16, 2024.

  1. How one can react to changes / perform side-effects when rxResource receives .value() instead of using effect()?

    Current approach in component:

    constructor() {
    this.service.setItemId(1); //setting signal
    effect(() => // work with data from async post request
    }


    in service:

    resource$ = rxResource({
    request: () => this.itemID$(), // signal
    loader: ({ request: id }) => {
    return this.http.post('http://');
    }
    });

    Continue reading...

Compartilhe esta Página