Closed kthomas182 closed 5 years ago
Yes, you can just create a third file and create the subject there like:
export const notifier = new Subject();
Then, where your cache buster service is (orer-entry.service.ts), use it like:
import {notifier} from '../where-you-defined-this';
@CacheBuster({
cacheBusterNotifier: notifier
})
createNewOrder()
and in the order.service.ts
-
import {notifier} from '../where-you-defined-this';
@Cacheable({
cacheBusterObserver: notifier.asObservable()
})
getOrders()
@kthomas182, let me know if you got any other questions. Closing this for now :)
Hi dear friend, I need your help, can I notify two objects:
const notifier1 = new Subject(); const notifier2 = new Subject();
@CacheBuster({ cacheBusterNotifier: notifier1, notifier2 })
I want to notify two services.
thank you!
I found a solution using this:
//agence.service.ts file
export const agenceCache = new Subject
//societe.service.ts file
import { agenceCache } from '../../service/agence/agence.service';
const societeCache = new Subject
@CacheBuster({
cacheBusterNotifier: societeCache,
})
@CacheBuster({
cacheBusterNotifier: agenceCache,
})
public updateSociete(societeId: number, societe: Societe) {
return this.httpClient.put(${environment.api}/societe/${societeId}
, societe);
}
thank you!
Is it possible to set a cacheBusterNotifier from another service?
Ex.