import { Injectable, signal } from '@angular/core'; export interface FastcheckData { fastcheck: string; amount: number | null; code: string; expiration?: string; } /** * Shared state between the home (Fastcheck) page and the create-new page. * When a new fastcheck is created via POST /fastcheck, the create page stores * the returned data here and the home page reads it to autofill its fields. */ @Injectable({ providedIn: 'root' }) export class FastcheckService { readonly created = signal(null); setCreated(data: FastcheckData): void { this.created.set(data); } consume(): FastcheckData | null { const value = this.created(); this.created.set(null); return value; } }