Reactix
- Package
- purescript-reactix
- Repository
- garganscript/purescript-reactix
Re-exports from Reactix.Hooks
#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
#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.
#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
#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
#useLayoutEffectFn3' Source
useLayoutEffectFn3' :: forall a b c. a -> b -> c -> (a -> b -> c -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with three memo values
#useLayoutEffectFn2' Source
useLayoutEffectFn2' :: forall a b. a -> b -> (a -> b -> Effect Unit) -> Hooks Unit
like useLayoutEffectFn1', but with two memo values
#useLayoutEffectFn1' Source
useLayoutEffectFn1' :: forall a. a -> (a -> Effect Unit) -> Hooks Unit
Like useLayoutEffect1, but takes a function from memo value to effect
#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
#useLayoutEffect4' Source
useLayoutEffect4' :: forall a b c d e. a -> b -> c -> d -> Effect e -> Hooks Unit
Like useLayoutEffect1' but with 4 memo values
#useLayoutEffect3' Source
useLayoutEffect3' :: forall a b c d. a -> b -> c -> Effect d -> Hooks Unit
Like useLayoutEffect1' but with 3 memo values
#useLayoutEffect2' Source
useLayoutEffect2' :: forall a b c. a -> b -> Effect c -> Hooks Unit
Like useLayoutEffect1' but with 2 memo values
#useLayoutEffect1' Source
useLayoutEffect1' :: forall a b. a -> Effect b -> Hooks Unit
Like useLayoutEffect1, but the provided Effect fn does not return a cleanup handler
#useLayoutEffect' Source
useLayoutEffect' :: forall a. Effect a -> Hooks Unit
Like useLayoutEffect, but the provided Effect fn does not return a cleanup handler
#useImperativeHandle5 Source
useImperativeHandle5 :: forall a b c d e r r'. a -> b -> c -> d -> e -> 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
#useImperativeHandle3 Source
useImperativeHandle3 :: forall a b c r r'. a -> b -> c -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle2 Source
useImperativeHandle2 :: forall a b r r'. a -> b -> Ref r -> Effect r' -> Hooks Unit
#useImperativeHandle1 Source
useImperativeHandle1 :: forall a r r'. a -> Ref r -> Effect r' -> Hooks Unit
#useEffectOnce' Source
useEffectOnce' :: forall a. Effect a -> Hooks Unit
Like useEffectOnce, 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
#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
#useEffectFn3' Source
useEffectFn3' :: forall a b c. a -> b -> c -> (a -> b -> c -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with three memo values
#useEffectFn2' Source
useEffectFn2' :: forall a b. a -> b -> (a -> b -> Effect Unit) -> Hooks Unit
like useEffectFn1', but with two memo values
#useEffectFn1' Source
useEffectFn1' :: forall a. a -> (a -> Effect Unit) -> Hooks Unit
Like useEffect1', but takes a function from memo value to effect
#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
#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
#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
#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
#useEffect1' Source
useEffect1' :: forall a b. a -> Effect b -> Hooks Unit
Like useEffect1, 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
#useDebugValue' Source
useDebugValue' :: forall v. v -> Hooks Unit
#useDebugValue Source
useDebugValue :: forall v v'. v -> (v -> v') -> Hooks Unit
#useContext Source
useContext :: forall a. Context a -> Hooks a
Given a Context
, returns its current value
#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
#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
#useCallback3 Source
useCallback3 :: forall a b c t. a -> b -> c -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 3 memo values
#useCallback2 Source
useCallback2 :: forall a b t. a -> b -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes 2 memo values
#useCallback1 Source
useCallback1 :: forall a t. a -> (Unit -> t) -> Hooks (Effect t)
Like useCallback
but takes a memo value
#useCallback Source
useCallback :: forall t. (Unit -> t) -> Hooks (Effect t)
Given a function to compute an expensive value, returns the value
#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.
#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.
#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.
#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
Re-exports from Reactix.React
#StaticComponent Source
type StaticComponent :: Row Type -> Type
type StaticComponent props = Record props -> Array Element -> Element
#Provider Source
data Provider t0
The Provider for a React Context
Instances
IsComponent (Provider v) (value :: v) (Array Element)
#HooksComponent Source
type HooksComponent :: Row Type -> Type
type HooksComponent props = Record props -> Array Element -> Hooks Element
The type of a function that can be turned into a component with
hooksComponent
. Will have access to the Hooks
Monad.
#Element Source
data Element
A React Element node
Instances
IsComponent (Component props) props (Array Element)
IsComponent (Memo props) props (Array Element)
IsComponent (Provider v) (value :: v) (Array Element)
IsComponent (Consumer v) () (v -> Element)
Semigroup Element
Monoid Element
#Consumer Source
data Consumer t0
The Consumer for a React Context
Instances
IsComponent (Consumer v) () (v -> Element)
#IsComponent Source
class IsComponent :: Type -> Row Type -> Type -> Constraint
class IsComponent component (props :: Row Type) children | component -> props, component -> children where
Members
createElement :: component -> Record props -> children -> Element
Instances
IsComponent (Component props) props (Array Element)
IsComponent (Memo props) props (Array Element)
IsComponent (Provider v) (value :: v) (Array Element)
IsComponent (Consumer v) () (v -> Element)
#MonadDelay Source
class MonadDelay :: (Type -> Type) -> Constraint
class (Monad m) <= MonadDelay m
This class is for Monads whose side effect includes delayed computation. So far, it's Effect and Hooks.
Instances
#unsafeHooksEffect Source
unsafeHooksEffect :: forall a. Effect a -> Hooks a
#staticComponentWithModule Source
staticComponentWithModule :: forall props. Module -> String -> StaticComponent props -> Component props
#staticComponent Source
staticComponent :: forall props. String -> StaticComponent props -> Component props
Turns a StaticComponent
function into a Component
#readRefM Source
readRefM :: forall r m. MonadDelay m => Ref r -> m r
#readNullableRefM Source
readNullableRefM :: forall r m. MonadDelay m => Ref (Nullable r) -> Effect (Maybe r)
#rawCreateElement Source
rawCreateElement :: forall c p cs. c -> p -> Array cs -> Element
#hooksComponentWithModule Source
hooksComponentWithModule :: forall props. Module -> String -> HooksComponent props -> Component props
#hooksComponent Source
hooksComponent :: forall props. String -> HooksComponent props -> Component props
Turns a HooksComponent
function into a Component
#createRef Source
createRef :: forall r. Unit -> NullableRef r
#createContext Source
createContext :: forall v. v -> Context v
Creates a Context
from a given value
Re-exports from Reactix.SyntheticEvent
#SyntheticEvent Source
data SyntheticEvent t0
#unsafeEventValue Source
unsafeEventValue :: forall event. event -> String
#unsafeEventTarget Source
unsafeEventTarget :: forall event. event -> Element