Function treeshakable

Creates a tree-shakable store.

const store = treeshakable('my-store', () => createStore(...));
  • Type Parameters

    • T

      The type of the store

    Parameters

    • key: string

      A unique key for the store

    • storeCreator: () => T

      A function that creates a new store

    Returns T

    A tree-shakable store