PhilippMDoerner / nimstoryfont-gui

An overhaul over aldrunewiki-frontend, reflecting everything I've learned since then.
GNU General Public License v3.0
0 stars 0 forks source link

Finish implementing backend #1

Open PhilippMDoerner opened 1 year ago

PhilippMDoerner commented 1 year ago

Use the Effectsfactory for this to avoid the boilerplate-y bits.

effects:

resolvers:

actions:

service-calls:

PhilippMDoerner commented 1 week ago

Changing approaches, how about trying to go for using signal stores. Maybe that can take away some of the boilerplate

PhilippMDoerner commented 1 day ago

Changing approach, signal store features are a pain to work with type-wise. Particularly for more complex features such as request caching.Migrating to an approach of services with subjects that you create via a factory.

PhilippMDoerner commented 3 hours ago

Service approach works, can migrate that to a somewhat cleaner version: Have a Subject that triggers http requests and forwards args from the function call like this:

class MyService {
  private load$ = new Subject<void>();
  readonly data$ = this.load$.pipe(
    switchMap(() => this.http.get(...)),
    shareReplay(1),
  );
  load() {
    this.load$.next();
  }
}