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 > useScopedSelector

useScopedSelector() function

React Hook to get the value of an selector in the current scope

Signature:
export declare function useScopedSelector<T>(
  scopedSelector: (state: ScopedState) => T,
  enforcedScope?: string
): T

Parameters

ParameterTypeDescription
scopedSelector(state: ScopedState) => TThe selector
enforcedScopestringIf provided, used as the scope instead of the current scope
Returns:

T

The value of the selector in the current scope