New singleton to hold cache globally in-memory
This commit is contained in:
17
src/app/cache.ts
Normal file
17
src/app/cache.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
import { Contact } from 'chatenium-sdk-preview';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class Cache {
|
||||
contacts = signal<Contact[]>([])
|
||||
contactsState = signal<LoadState>(LoadState.CLEAN_LOADING)
|
||||
}
|
||||
|
||||
export enum LoadState {
|
||||
CLEAN_LOADING,
|
||||
CACHE_UPDATING,
|
||||
LOADED,
|
||||
ERROR
|
||||
}
|
||||
Reference in New Issue
Block a user