UNPKG

@logux/state

Version:

A tiny (152 bytes) state manager for React/Preact/Vue/Svelte with many atomic tree-shakable stores

14 lines (12 loc) 321 B
export const clean = Symbol('clean') export function cleanStores(...stores) { if (process.env.NODE_ENV === 'production') { throw new Error( 'cleanStores() can be used only during development or tests' ) } for (let store of stores) { if (store.mocked) delete store.mocked store[clean]() } }