New singleton to hold cache globally in-memory

This commit is contained in:
Noel Maróti
2026-11-28 07:13:18 +01:00
parent 043a97ada5
commit 1988c0a61e
2 changed files with 33 additions and 0 deletions

17
src/app/cache.ts Normal file
View 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
}