The API reference is a Work in Progress and will be continuously improved and extended. We'd love to hear your feedback in our documentation repository.

Home > @edtr-io/core > useScopedStore

useScopedStore() function

React Hook to obtain a reference to the scoped store

export declare function useScopedStore(
  enforcedScope?: string
): {
  dispatch: (scopedAction: (scope: string) => Action) => void
  getState: () => ScopedState
  subscribe: (listener: () => void) => Unsubscribe


enforcedScopestringIf provided, used as the scope instead of the current scope

{ dispatch: (scopedAction: (scope: string) => Action) => void; getState: () => ScopedState; subscribe: (listener: () => void) => Unsubscribe; }

The scoped store