Function createStoreWithOptionalDevtools

  • Creates a Zustand store with optional DevTools middleware.

    Type Parameters

    • T extends object

    Parameters

    • initialState: T

      The initial state of the store.

    • config: DevtoolsOptions & {
          withDevtools?: boolean;
      }

      Configuration options for DevTools.

    Returns types.StoreWithAllMiddleware<T> | types.StoreWithSubscribeOnly<T>

    A Zustand store with DevTools enabled if configured, otherwise a standard store.