AppleSauce
    Preparing search index...

    Function useLayoutSubscription

    • Same as [[useSubscription]] except the subscription is established under useLayoutEffect.

      Useful when values are needed before DOM paint.

      Use it scarcely as it runs synchronously before browser paint. Too many synchronous emissions from the observable could stretch the commit phase.

      Type Parameters

      • TInput

        Input value within Observable.

      Parameters

      Returns MutableRefObject<Subscription | undefined>

    • Type Parameters

      • TInput

        Input value within Observable.

      Parameters

      • input$: Observable<TInput>

        Input Observable.

      • Optionalnext: ((value: TInput) => void) | null

        Notify when a new value is emitted.

      • Optionalerror: ((error: any) => void) | null

        Notify when a new error is thrown.

      • Optionalcomplete: (() => void) | null

        Notify when the Observable is complete.

      Returns MutableRefObject<Subscription | undefined>