uix.hooks.alpha
Wrappers for React.js Hooks
callback
(callback f)
(callback f deps)
Takes function f and optional vector of dependencies, and returns f.
effect!
(effect! setup-fn)
(effect! setup-fn deps)
Takes a function to be executed in an effect and optional vector of dependencies.
See: https://reactjs.org/docs/hooks-reference.html#useeffect
IRef
protocol
members
unwrap
(unwrap this)
layout-effect!
(layout-effect! setup-fn)
(layout-effect! setup-fn deps)
Takes a function to be executed in a layout effect and optional vector of dependencies.
See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
maybe-js-deps
macro
(maybe-js-deps deps)
maybe-ret-fn
macro
(maybe-ret-fn f)
memo
(memo f)
(memo f deps)
Takes function f and optional vector of dependencies, and returns memoized f.
ref
(ref)
(ref value)
Takes optional initial value and returns an instance of RefHook.
state
(state value)
with-deps-check
macro
(with-deps-check [prev-deps] f deps)
with-effect
macro
(with-effect deps body)
Takes optional vector of dependencies and body to be executed in an effect.
with-layout-effect
macro
(with-layout-effect deps body)
Takes optional vector of dependencies and body to be executed in a layout effect.