Reactix.Hooks
- Package
- purescript-reactix
- Repository
- garganscript/purescript-reactix
#useReducer Source
useReducer :: forall s a i. (s -> a -> s) -> (i -> s) -> i -> Hooks (Reducer s a)
Given a reducer function from a state and action to a new state, an initialiser function and argument for the initialiser, returns a Reducer. Note args 2 and 3 are swapped in order from React.
#useReducer' Source
useReducer' :: forall s a. (s -> a -> s) -> s -> Hooks (Reducer s a)
Like useReducer
, but takes an initial state instead of an
initialiser function and argument
#useContext Source
useContext :: forall a. Context a -> Hooks a
Given a Context
, returns its current value
#useDebugValue Source
useDebugValue :: forall v v'. v -> (v -> v') -> Hooks Unit
#useDebugValue' Source
useDebugValue' :: forall v. v -> Hooks Unit
#thenNothing Source
thenNothing :: forall a. Effect a -> Effect (Effect Unit)
Turns a simple effect function into an effect function that does nothing in cleanup after running
#useEffectOnce' Source
useEffectOnce' :: forall a. Effect a -> Hooks Unit
Like useEffectOnce, but the provided Effect fn does not return a cleanup handler
#useEffect' Source
useEffect' :: forall a. Effect a -> Hooks Unit
Like useEffect, but the provided Effect fn does not return a cleanup handler
#useEffect1' Source
useEffect1' :: forall a b. a -> Effect b -> Hooks Unit
Like useEffect1, but the provided Effect fn does not return a cleanup handler
#useEffectFn1' Source
useEffectFn1' :: forall a. a -> (a -> Effect Unit) -> Hooks Unit
Like useEffect1', but takes a function from memo value to effect
#useEffect2' Source
useEffect2' :: forall a b c. a -> b -> Effect c -> Hooks Unit
Like useEffect2, but the provided Effect fn does not return a cleanup handler
#useEffectFn2' Source
useEffectFn2' :: forall a b. a -> b -> (a -> b -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with two memo values
#useEffect3' Source
useEffect3' :: forall a b c d. a -> b -> c -> Effect d -> Hooks Unit
Like useEffect3, but the provided Effect fn does not return a cleanup handler
#useEffectFn3' Source
useEffectFn3' :: forall a b c. a -> b -> c -> (a -> b -> c -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with three memo values
#useEffect4' Source
useEffect4' :: forall a b c d e. a -> b -> c -> d -> Effect e -> Hooks Unit
Like useEffect4, but the provided Effect fn does not return a cleanup handler
#useEffectFn4' Source
useEffectFn4' :: forall a b c d. a -> b -> c -> d -> (a -> b -> c -> d -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with four memo values
#useEffect5' Source
useEffect5' :: forall a b c d e f. a -> b -> c -> d -> e -> Effect f -> Hooks Unit
Like useEffect5, but the provided Effect fn does not return a cleanup handler
#useEffectFn5' Source
useEffectFn5' :: forall a b c d e. a -> b -> c -> d -> e -> (a -> b -> c -> d -> e -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with five memo values
#useLayoutEffect' Source
useLayoutEffect' :: forall a. Effect a -> Hooks Unit
Like useLayoutEffect, but the provided Effect fn does not return a cleanup handler
#useLayoutEffect1' Source
useLayoutEffect1' :: forall a b. a -> Effect b -> Hooks Unit
Like useLayoutEffect1, but the provided Effect fn does not return a cleanup handler
#useLayoutEffectFn1' Source
useLayoutEffectFn1' :: forall a. a -> (a -> Effect Unit) -> Hooks Unit
Like useLayoutEffect1, but takes a function from memo value to effect
#useLayoutEffect2' Source
useLayoutEffect2' :: forall a b c. a -> b -> Effect c -> Hooks Unit
Like useLayoutEffect1' but with 2 memo values
#useLayoutEffectFn2' Source
useLayoutEffectFn2' :: forall a b. a -> b -> (a -> b -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with two memo values
#useLayoutEffect3' Source
useLayoutEffect3' :: forall a b c d. a -> b -> c -> Effect d -> Hooks Unit
Like useLayoutEffect1' but with 3 memo values
#useLayoutEffectFn3' Source
useLayoutEffectFn3' :: forall a b c. a -> b -> c -> (a -> b -> c -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with three memo values
#useLayoutEffect4' Source
useLayoutEffect4' :: forall a b c d e. a -> b -> c -> d -> Effect e -> Hooks Unit
Like useLayoutEffect1' but with 4 memo values
#useLayoutEffectFn4' Source
useLayoutEffectFn4' :: forall a b c d. a -> b -> c -> d -> (a -> b -> c -> d -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with four memo values
#useLayoutEffect5' Source
useLayoutEffect5' :: forall a b c d e f. a -> b -> c -> d -> e -> Effect f -> Hooks Unit
Like useLayoutEffect1' but with 5 memo values
#useLayoutEffectFn5' Source
useLayoutEffectFn5' :: forall a b c d e. a -> b -> c -> d -> e -> (a -> b -> c -> d -> e -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with five memo values
#unsafeUseMemo Source
unsafeUseMemo :: forall t a. (Unit -> t) -> a -> Hooks t
Call React.useMemo passing an array-like object (arguments is acceptable) for memo values without any help from the type system to guarantee the memo value is in fact array-like.
#useCallback Source
useCallback :: forall t. (Unit -> t) -> Hooks (Effect t)
Given a function to compute an expensive value, returns the value
#useCallback1 Source
useCallback1 :: forall a t. a -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes a memo value
#useCallback2 Source
useCallback2 :: forall a b t. a -> b -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 2 memo values
#useCallback3 Source
useCallback3 :: forall a b c t. a -> b -> c -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 3 memo values
#useCallback4 Source
useCallback4 :: forall a b c d t. a -> b -> c -> d -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 4 memo values
#useCallback5 Source
useCallback5 :: forall a b c d e t. a -> b -> c -> d -> e -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 5 memo values
#unsafeUseCallback Source
unsafeUseCallback :: forall t a. (Unit -> t) -> a -> Hooks (Effect t)
Call React.useCallback passing an array-like object (arguments is acceptable) for memo values without any help from the type system to guarantee the memo value is in fact array-like.
#useImperativeHandle1 Source
useImperativeHandle1 :: forall a r r'. a -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle2 Source
useImperativeHandle2 :: forall a b r r'. a -> b -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle3 Source
useImperativeHandle3 :: forall a b c r r'. a -> b -> c -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle4 Source
useImperativeHandle4 :: forall a b c d r r'. a -> b -> c -> d -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle5 Source
useImperativeHandle5 :: forall a b c d e r r'. a -> b -> c -> d -> e -> Ref r -> Effect r' -> Hooks Unit
#unsafeUseImperativeHandle Source
unsafeUseImperativeHandle :: forall r r' a. Ref r -> Effect r' -> a -> Hooks Unit
Call React.useImperativeHandle passing an array-like object (arguments is acceptable) for memo values without any help from the type system to guarantee the memo value is in fact array-like.