feat(cardex): implement cardex module with filters, templates, and service integration
This commit is contained in:
@@ -13,6 +13,7 @@ export interface BaseState<T = any> {
|
||||
items?: T;
|
||||
meta?: Maybe<IPaginatedQuery>;
|
||||
isRefreshing?: boolean;
|
||||
initialized: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +78,7 @@ export abstract class BaseStore<T extends BaseState> {
|
||||
readonly state: Signal<T>;
|
||||
readonly loading: Signal<boolean>;
|
||||
readonly error: Signal<Maybe<string>>;
|
||||
readonly initialized: Signal<boolean>;
|
||||
|
||||
// Observable for RxJS compatibility
|
||||
readonly state$: Observable<T>;
|
||||
@@ -89,6 +91,7 @@ export abstract class BaseStore<T extends BaseState> {
|
||||
this.state = this._state.asReadonly();
|
||||
this.loading = computed(() => this._state().loading);
|
||||
this.error = computed(() => this._state().error);
|
||||
this.initialized = computed(() => this._state().initialized);
|
||||
|
||||
// Observable for RxJS compatibility
|
||||
this.state$ = this._stateSubject.asObservable();
|
||||
|
||||
@@ -85,6 +85,7 @@ export class GlobalStore extends BaseStore<GlobalState> {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
initialized: false,
|
||||
loading: false,
|
||||
error: null,
|
||||
sidebarCollapsed: false,
|
||||
@@ -300,6 +301,7 @@ export class GlobalStore extends BaseStore<GlobalState> {
|
||||
*/
|
||||
reset(): void {
|
||||
this.setState({
|
||||
initialized: false,
|
||||
loading: false,
|
||||
error: null,
|
||||
sidebarCollapsed: false,
|
||||
|
||||
Reference in New Issue
Block a user