diff --git a/src/app/cache.spec.ts b/src/app/cache.spec.ts new file mode 100644 index 0000000..64deeb6 --- /dev/null +++ b/src/app/cache.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { Cache } from './cache'; + +describe('Cache', () => { + let service: Cache; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(Cache); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/cache.ts b/src/app/cache.ts new file mode 100644 index 0000000..87eda74 --- /dev/null +++ b/src/app/cache.ts @@ -0,0 +1,17 @@ +import { Injectable, signal } from '@angular/core'; +import { Contact } from 'chatenium-sdk-preview'; + +@Injectable({ + providedIn: 'root', +}) +export class Cache { + contacts = signal([]) + contactsState = signal(LoadState.CLEAN_LOADING) +} + +export enum LoadState { + CLEAN_LOADING, + CACHE_UPDATING, + LOADED, + ERROR +}