import type { Canonical } from "atom.io/foundations/canonical" import { disposeFromStore, IMPLICIT } from "atom.io/internal" import type { ReadableFamilyToken, ReadableToken } from "." /** * Disposes of a state in the implicit store. * * Only family members can be disposed of. * * @param token - The token of the state to dispose * @overload Default */ export function disposeState(token: ReadableToken): void /** * Disposes of a state in the implicit store. * * Only family members can be disposed of. * * @param token - The token of the state family to dispose * @param key - The unique key of the state to dispose * @overload Streamlined */ export function disposeState( token: ReadableFamilyToken, key: K, ): void export function disposeState( ...params: | [token: ReadableFamilyToken, key: Canonical] | [token: ReadableToken] ): void { disposeFromStore(IMPLICIT.STORE, ...params) }