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

      • input$: Observable<TInput>

        Input Observable.

      • Optionalobserver: PartialObserver<TInput>

        Observer

      Returns MutableRefObject<undefined | Subscription>

    • Type Parameters

      • TInput

        Input value within Observable.

      Parameters

      • input$: Observable<TInput>

        Input Observable.

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

        Notify when a new value is emitted.

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

        Notify when a new error is thrown.

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

        Notify when the Observable is complete.

      Returns MutableRefObject<undefined | Subscription>