@pbroom/color-kit/reactColor

ColorStore

Minimal external store for shared color state. The provider owns one store instance; child components subscribe to referentially stable slices via useColorStoreSelector so provider renders stay cheap.

interfaceimport type { ColorStore } from '@pbroom/color-kit/react';color-store.ts:16
interface ColorStore {
  get: () => ColorState;
  set: (next: ColorState) => void;
  subscribe: (listener: () => void) => () => void;
}

Properties

get() => ColorState
Returns the current state.
set(next: ColorState) => void
Replaces the state and notifies listeners; a no-op when next is the current state object.
subscribe(listener: () => void) => () => void
Registers a change listener and returns its unsubscribe function.