question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hello, when I’m adding a new item, it don’t refresh data

const cacheBuster$ = new Subject<void>();

@Injectable({
  providedIn: 'root',
})
export class CollectsScheduleService {
  constructor(private http: HttpClient) {}

  @Cacheable({
    cacheBusterObserver: cacheBuster$,
  })
  getAll(crematoriumId: number): Observable<CollectSchedule[]> {
    return this.http.get<CollectSchedule[]>(
      `/collect-schedule/crematorium/${crematoriumId}`
    );
  }

  @CacheBuster({
    cacheBusterNotifier: cacheBuster$,
  })
  add(day: Day, zoneId: number): Observable<CollectSchedule> {
    return this.http.post<CollectSchedule>('/collect-schedule', {
      day,
      zoneId,
    });
  }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
angelnikolovcommented, Jun 10, 2021

@ismailkoksal Can you check this example? https://stackblitz.com/edit/ngx-cacheable-my31me?file=src%2Fapp%2Fapp.component.ts We have a get/update/get and it all works. It uses the latest version of ts-cacheable.

0reactions
ismailkoksalcommented, Jun 10, 2021

This is working

// service.ts

export const cacheBuster$ = new BehaviorSubject<void>(undefined);

@Cacheable({
  cacheBusterObserver: cacheBuster$,
})
getAll(): Observable<any[]> {
  // Return an Observable
}

@CacheBuster({
  cacheBusterNotifier: cacheBuster$,
})
add(): Observable<any> {
  // Return an Observable
}
// component.ts

constructor(private service: Service) {
  this.all$ = cacheBuster$.pipe(switchMap(() => service.getAll()));
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Data refresh in Power BI
For Power BI users, refreshing data typically means importing data from the original data sources into a dataset, either based on a refresh ......
Read more >
Refresh data
To update the entire workbook, on the IBM® Planning Analytics tab, click Refresh All Data. If you choose the Refresh the data only...
Read more >
Refresh charted data - MATLAB refreshdata
refreshdata updates charted data in the current figure to reflect changes in workspace variables. Before using refreshdata , you must first set the...
Read more >
Refresh Data Sources
Refreshing the data source will update any new or changed fields. ... of the extract are managed by Tableau Server and can only...
Read more >
What is the difference between an Update and a Data ...
An algorithm is only as good as the data is it based on. The data base on which the algorithm updates are founded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found