The slimmed chemical records to store.
Epoch milliseconds the dataset was downloaded; drives TTL expiry.
Resolves once the write completes; errors are logged, not thrown.
await putChemicalDb(records, Date.now());
export async function putChemicalDb(chemicals: OshaChemical[], fetchedAt: number): Promise<void> {
try {
const db = await getDB();
await db.put(IDB_STORE.CHEMICAL_DB, { id: CHEMICAL_DB_KEY, fetchedAt, chemicals });
} catch (error) {
logger.error(`Failed to write chemical DB to IndexedDB: ${getErrorMessage(error)}`, { error });
}
}
Replaces the cached OSHA OBIS chemical dataset.