Atomic Angular — Doc interne

User settings

The signal store that persists a signed-in user's preferences — language, theme, bookmarks, recent and saved searches, baskets, alerts — to the backend.

UserSettingsStore holds the parts of a user's experience that outlive one session — recent searches, bookmarks, saved searches, baskets, alerts, language and assistant preferences — and keeps them synced with the backend on every mutation.

Minimal example

Initialize once, read a preference
app.component.ts
import { Component, inject, OnInit } from "@angular/core";
import { UserSettingsStore } from "@sinequa/atomic-angular";

@Component({
  selector: "app-root",
  template: `<p>{{ userSettings.language() }}</p>`,
})
export class AppComponent implements OnInit {
  protected readonly userSettings = inject(UserSettingsStore);

  async ngOnInit() {
    await this.userSettings.initialize();
  }
}

Every mutation method (bookmark(), createAlert(), updateLanguage(), …) both patches the store and persists the change to the backend API in the same call — there is no separate "save" step, and a signal read anywhere in the app reflects the change immediately.

Options

Prop

Type

Every mutator that logs activity also accepts an optional auditEvents parameter, forwarded to the audit interceptor.

Pitfalls

What's next

On this page