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

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

Parameters

ParameterTypeDescription
enforcedScopestringIf provided, used as the scope instead of the current scope
Returns:

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

The scoped store