CLJS
basic-lein-cljs.core
cljs.analyzer
cljs.compiler
CLJS
cljs.core
CLJS
cljs.core.async
CLJS
cljs.core.async.impl.buffers
CLJS
cljs.core.async.impl.channels
CLJS
cljs.core.async.impl.dispatch
CLJS
cljs.core.async.impl.ioc-helpers
CLJS
cljs.core.async.impl.protocols
CLJS
cljs.core.async.impl.timers
cljs.env
cljs.externs
CLJS
cljs.js
cljs.js-deps
CLJS
cljs.pprint
CLJS
cljs.reader
CLJS
cljs.repl
cljs.source-map
CLJS
cljs.source-map
cljs.source-map.base64
CLJS
cljs.source-map.base64
cljs.source-map.base64-vlq
CLJS
cljs.source-map.base64-vlq
CLJS
cljs.spec.alpha
CLJS
cljs.spec.gen.alpha
cljs.tagged-literals
CLJS
cljs.tools.reader
CLJS
cljs.tools.reader.edn
CLJS
cljs.tools.reader.impl.commons
CLJS
cljs.tools.reader.impl.errors
CLJS
cljs.tools.reader.impl.inspect
CLJS
cljs.tools.reader.impl.utils
CLJS
cljs.tools.reader.reader-types
cljs.util
clojure.core
clojure.core.async
clojure.core.async.impl.buffers
clojure.core.async.impl.channels
clojure.core.async.impl.concurrent
clojure.core.async.impl.dispatch
clojure.core.async.impl.exec.threadpool
clojure.core.async.impl.ioc-macros
clojure.core.async.impl.mutex
clojure.core.async.impl.protocols
clojure.core.async.impl.timers
clojure.core.cache
clojure.core.memoize
clojure.core.protocols
clojure.core.server
clojure.data.json
clojure.data.priority-map
clojure.edn
clojure.instant
clojure.java.io
clojure.main
clojure.pprint
clojure.reflect
clojure.repl
clojure.set
CLJS
clojure.set
clojure.spec.alpha
clojure.spec.gen.alpha
clojure.string
CLJS
clojure.string
clojure.tools.analyzer
clojure.tools.analyzer.ast
clojure.tools.analyzer.env
clojure.tools.analyzer.jvm
clojure.tools.analyzer.jvm.utils
clojure.tools.analyzer.passes
clojure.tools.analyzer.passes.add-binding-atom
clojure.tools.analyzer.passes.cleanup
clojure.tools.analyzer.passes.constant-lifter
clojure.tools.analyzer.passes.elide-meta
clojure.tools.analyzer.passes.emit-form
clojure.tools.analyzer.passes.jvm.analyze-host-expr
clojure.tools.analyzer.passes.jvm.annotate-host-info
clojure.tools.analyzer.passes.jvm.annotate-loops
clojure.tools.analyzer.passes.jvm.annotate-tag
clojure.tools.analyzer.passes.jvm.box
clojure.tools.analyzer.passes.jvm.classify-invoke
clojure.tools.analyzer.passes.jvm.constant-lifter
clojure.tools.analyzer.passes.jvm.emit-form
clojure.tools.analyzer.passes.jvm.fix-case-test
clojure.tools.analyzer.passes.jvm.infer-tag
clojure.tools.analyzer.passes.jvm.validate
clojure.tools.analyzer.passes.jvm.validate-loop-locals
clojure.tools.analyzer.passes.jvm.validate-recur
clojure.tools.analyzer.passes.jvm.warn-on-reflection
clojure.tools.analyzer.passes.source-info
clojure.tools.analyzer.passes.trim
clojure.tools.analyzer.passes.uniquify
clojure.tools.analyzer.passes.warn-earmuff
clojure.tools.analyzer.utils
clojure.tools.cli
clojure.tools.namespace.dependency
clojure.tools.namespace.file
clojure.tools.namespace.find
clojure.tools.namespace.parse
clojure.tools.namespace.track
clojure.tools.reader
clojure.tools.reader.default-data-readers
clojure.tools.reader.impl.commons
clojure.tools.reader.impl.errors
clojure.tools.reader.impl.inspect
clojure.tools.reader.impl.utils
clojure.tools.reader.reader-types
clojure.walk
CLJS
clojure.walk
dynadoc.aliases
dynadoc.common
dynadoc.core
CLJS
dynadoc.core
dynadoc.example
CLJS
dynadoc.state
dynadoc.static
dynadoc.utils
dynadoc.watch
eval-soup.clojail
eval-soup.core
CLJS
eval-soup.core
CLJS
figwheel.client
CLJS
figwheel.client.file-reloading
CLJS
figwheel.client.heads-up
CLJS
figwheel.client.socket
CLJS
figwheel.client.utils
hawk.core
hawk.watcher
html-soup.core
ns-tracker.core
ns-tracker.dependency
ns-tracker.nsdeps
ns-tracker.parse
CLJS
oakcljs.tools.reader
CLJS
oakcljs.tools.reader.impl.commons
CLJS
oakcljs.tools.reader.impl.errors
CLJS
oakcljs.tools.reader.impl.inspect
CLJS
oakcljs.tools.reader.impl.utils
CLJS
oakcljs.tools.reader.reader-types
oakclojure.tools.reader
oakclojure.tools.reader.default-data-readers
oakclojure.tools.reader.impl.commons
oakclojure.tools.reader.impl.errors
oakclojure.tools.reader.impl.inspect
oakclojure.tools.reader.impl.utils
oakclojure.tools.reader.reader-types
org.httpkit.server
CLJS
paren-soup.console
CLJS
paren-soup.core
CLJS
paren-soup.dom
CLJS
paren-soup.instarepl
CLJS
reagent.core
CLJS
reagent.debug
CLJS
reagent.dom
CLJS
reagent.impl.batching
CLJS
reagent.impl.component
CLJS
reagent.impl.template
CLJS
reagent.impl.util
CLJS
reagent.ratom
ring.middleware.content-type
ring.middleware.file
ring.middleware.head
ring.middleware.keyword-params
ring.middleware.params
ring.middleware.reload
ring.middleware.resource
ring.util.codec
ring.util.io
ring.util.mime-type
ring.util.parsing
ring.util.request
ring.util.response
ring.util.time
rum.core
CLJS
rum.core
rum.cursor
rum.derived-atom
rum.server-render
rum.util
sablono.compiler
CLJS
sablono.core
sablono.normalize
sablono.util
tag-soup.core

reagent.core

(adapt-react-class c opts)

(adapt-react-class c)

Returns an adapter for a native React class, that may be used just like a Reagent component function or class in Hiccup forms.

(after-render f)

Run f using requestAnimationFrame or equivalent. f will be called just after any queued renders in the next animation frame (and even if no renders actually occur).

(argv this)

Returns the entire Hiccup form passed to the component.

(as-element form)

Turns a vector of Hiccup syntax into a React element. Returns form unchanged if it is not a vector.

(atom x)

(atom x & rest)

Like clojure.core/atom, except that it keeps track of derefs. Reagent components that derefs one of these are automatically re-rendered.

(children this)

Returns the children passed to a component.

(create-class spec)

Create a component, React style. Should be called with a map, looking like this: {:get-initial-state (fn [this]) :component-will-receive-props (fn [this new-argv]) :should-component-update (fn [this old-argv new-argv]) :component-will-mount (fn [this]) :component-did-mount (fn [this]) :component-will-update (fn [this new-argv]) :component-did-update (fn [this old-argv]) :component-will-unmount (fn [this]) :reagent-render (fn [args....])} ;; or :render (fn [this]) Everything is optional, except either :reagent-render or :render.

(create-element type)

(create-element type props)

(create-element type props child)

(create-element type props child & children)

Create a native React element, by calling React.createElement directly. That means the second argument must be a javascript object (or nil), and that any Reagent hiccup forms must be processed with as-element. For example like this: (r/create-element "div" #js{:className "foo"} "Hi " (r/as-element [:strong "world!"]) which is equivalent to [:div.foo "Hi" [:strong "world!"]]

(current-component)

Returns the current React component (a.k.a this) in a component function.

(cursor src path)

Provide a cursor into a Reagent atom. Behaves like a Reagent atom but focuses updates and derefs to the specified path within the wrapped Reagent atom. e.g., (let [c (cursor ra [:nested :content])] ... @c ;; equivalent to (get-in @ra [:nested :content]) ... (reset! c 42) ;; equivalent to (swap! ra assoc-in [:nested :content] 42) ... (swap! c inc) ;; equivalence to (swap! ra update-in [:nested :content] inc) ) The first parameter can also be a function, that should look something like this: (defn set-get ([k] (get-in @state k)) ([k v] (swap! state assoc-in k v))) The function will be called with one argument – the path passed to cursor – when the cursor is deref'ed, and two arguments (path and new value) when the cursor is modified. Given that set-get function, (and that state is a Reagent atom, or another cursor) these cursors are equivalent: (cursor state [:foo]) and (cursor set-get [:foo]). Note that a cursor is lazy: its value will not change until it is used. This may be noticed with add-watch.

(dispose! x)

Stop the result of track! from updating.

(dom-node this)

Returns the root DOM node of a mounted component.

(flush)

Render dirty components immediately to the DOM. Note that this may not work in event handlers, since React.js does batching of updates there.

(force-update this)

(force-update this deep)

Force a component to re-render immediately. If the second argument is true, child components will also be re-rendered, even is their arguments have not changed.

(force-update-all)

Force re-rendering of all mounted Reagent components. This is probably only useful in a development environment, when you want to update components in response to some dynamic changes to code. Note that force-update-all may not update root components. This happens if a component 'foo' is mounted with `(render [foo])` (since functions are passed by value, and not by reference, in ClojureScript). To get around this you'll have to introduce a layer of indirection, for example by using `(render [#'foo])` instead.

(merge-props defaults props)

Utility function that merges two maps, handling :class and :style specially, like React's transferPropsTo.

(next-tick f)

Run f using requestAnimationFrame or equivalent. f will be called just before components are rendered.

(partial f & args)

Works just like clojure.core/partial, but the result can be compared with =

(props this)

Returns the props passed to a component.

(reactify-component c)

Returns an adapter for a Reagent component, that may be used from React, for example in JSX. A single argument, props, is passed to the component, converted to a map.

(render comp container)

(render comp container callback)

Render a Reagent component into the DOM. The first argument may be either a vector (using Reagent's Hiccup syntax), or a React element. The second argument should be a DOM node. Optionally takes a callback that is called when the component is in place. Returns the mounted component instance.

(replace-state this new-state)

Set state of a component. Equivalent to (reset! (state-atom this) new-state)

(rswap! a f & args)

Swaps the value of a to be (apply f current-value-of-atom args). rswap! works like swap!, except that recursive calls to rswap! on the same atom are allowed – and it always returns nil.

(set-state this new-state)

Merge component state with new-state. Equivalent to (swap! (state-atom this) merge new-state)

(state this)

Returns the state of a component, as set with replace-state or set-state. Equivalent to (deref (r/state-atom this))

(state-atom this)

Returns an atom containing a components state.

(track f & args)

Takes a function and optional arguments, and returns a derefable containing the output of that function. If the function derefs Reagent atoms (or track, etc), the value will be updated whenever the atom changes. In other words, @(track foo bar) will produce the same result as (foo bar), but foo will only be called again when the atoms it depends on changes, and will only trigger updates of components when its result changes. track is lazy, i.e the function is only evaluated on deref.

(track! f & args)

An eager version of track. The function passed is called immediately, and continues to be called when needed, until stopped with dispose!.

(unmount-component-at-node container)

Remove a component from the given DOM node.

(wrap value reset-fn & args)

Provide a combination of value and callback, that looks like an atom. The first argument can be any value, that will be returned when the result is deref'ed. The second argument should be a function, that is called with the optional extra arguments provided to wrap, and the new value of the resulting 'atom'. Use for example like this: (wrap (:foo @state) swap! state assoc :foo) Probably useful only for passing to child components.