• Preparing search index...
  • The search index is not available
@atomic-reactor/reactium-sdk-core
  • @atomic-reactor/reactium-sdk-core
  • useSelectHandle

Function useSelectHandle

  • useSelectHandle<T>(ID, cb): any
  • A custom React hook that selects a part of the state from a ReactiumSyncState instance.

    Type Parameters

    • T extends ReactiumSyncState<object>

      The type of the ReactiumSyncState instance.

    Parameters

    • ID: Path

      The ID of the ReactiumSyncState instance.

    • cb: ((state) => any)
        • (state): any
        • Parameters

          • state: any

          Returns any

    Returns any

    An object containing the ReactiumSyncState instance and the selected part of the state.

    Example

    // Assuming `state` is an instance of `ReactiumSyncState`
    const { handle, selected } = useSelectHandle('myState', 'path.to.part');

    Example

    // Assuming `state` is an instance of `ReactiumSyncState`
    const { handle, selected } = useSelectHandle('myState', state => state.get('path.to.part'));

    See

    • useRegisterSyncHandle
    • Path
    • https://www.npmjs.com/package/object-path|object-path
    • Defined in dev/Reactium/reactium-sdk-core/src/browser/useSelectHandle.ts:31
  • useSelectHandle<T>(ID, selector, defaultValue?): any
  • Type Parameters

    • T extends ReactiumSyncState<object>

    Parameters

    • ID: Path
    • selector: Path
    • Optional defaultValue: any

    Returns any

    • Defined in dev/Reactium/reactium-sdk-core/src/browser/useSelectHandle.ts:35

Settings

Member Visibility

Theme

@atomic-reactor/reactium-sdk-core
  • Loading...

Generated using TypeDoc