Liking cljdoc? Tell your friends :D

om.next


*logger*cljs

source

*raf*clj/s

source

-next-propscljs

(-next-props next-props component)
source

-prev-propscljs

(-prev-props prev-props component)
source

add-root!clj/s

(add-root! reconciler root-class target)
(add-root! reconciler root-class target options)

Given a root component class and a target root DOM node, instantiate and render the root class using the reconciler's :state property. The reconciler will continue to observe changes to :state and keep the target node in sync. Note a reconciler may have only one root. If invoked on a reconciler with an existing root, the new root will replace the old one.

Given a root component class and a target root DOM node, instantiate and
render the root class using the reconciler's :state property. The reconciler
will continue to observe changes to :state and keep the target node in sync.
Note a reconciler may have only one root. If invoked on a reconciler with an
existing root, the new root will replace the old one.
sourceraw docstring

annotate-mutationsclj/s

(annotate-mutations tx ident)

Given a query expression annotate all mutations by adding a :mutator -> ident entry to the metadata of each mutation expression in the query.

Given a query expression annotate all mutations by adding a :mutator -> ident
entry to the metadata of each mutation expression in the query.
sourceraw docstring

app-rootclj/s

(app-root reconciler)

Return the application's root component.

Return the application's root component.
sourceraw docstring

app-stateclj/s

(app-state reconciler)

Return the reconciler's application state atom. Useful when the reconciler was initialized via denormalized data.

Return the reconciler's application state atom. Useful when the reconciler
was initialized via denormalized data.
sourceraw docstring

ast->queryclj/s

(ast->query query-ast)
source

childrenclj/s

(children component)

Returns the component's children.

Returns the component's children.
sourceraw docstring

class->anyclj/s

(class->any x class)

Get any component from the indexer that matches the component class.

Get any component from the indexer that matches the component class.
sourceraw docstring

class-pathclj/s

(class-path c)

Return the component class path associated with a component.

Return the component class path associated with a component.
sourceraw docstring

class-path->queriesclj/s

(class-path->queries x y)

Given x (a reconciler or indexer) and y (a component or component class path), return the queries for that path.

Given x (a reconciler or indexer) and y (a component or component class
path), return the queries for that path.
sourceraw docstring

collect-staticsclj/s

(collect-statics dt)
source

component?clj/s

(component? x)

Returns true if the argument is an Om component.

Returns true if the argument is an Om component.
sourceraw docstring

computedclj/s

(computed props computed-map)

Add computed properties to props. Note will replace any pre-existing computed properties.

Add computed properties to props. Note will replace any pre-existing
computed properties.
sourceraw docstring

db->treeclj/s

(db->tree query data refs)
(db->tree query data refs map-ident)

Given a query, some data in the default database format, and the entire application state in the default database format, return the tree where all ident links have been replaced with their original node values.

Given a query, some data in the default database format, and the entire
application state in the default database format, return the tree where all
ident links have been replaced with their original node values.
sourceraw docstring

default-extract-errorsclj/s

(default-extract-errors reconciler res query)
source

default-mergeclj/s

(default-merge reconciler state res query)
source

default-merge-identclj/s

(default-merge-ident _ tree ref props)
source

default-merge-treeclj/s

(default-merge-tree a b)
source

default-migrateclj/s

(default-migrate app-state-pure query tempids)
(default-migrate app-state-pure query tempids id-key)

Given app-state-pure (the application state as an immutable value), a query, tempids (a hash map from tempid to stable id), and an optional id-key keyword, return a new application state value with the tempids replaced by the stable ids.

Given app-state-pure (the application state as an immutable value), a query,
tempids (a hash map from tempid to stable id), and an optional id-key
keyword, return a new application state value with the tempids replaced by
the stable ids.
sourceraw docstring

default-ui->propsclj/s

(default-ui->props {:keys [parser pathopt] :as env} c)
source

defuiclj/s≠macro

clj
(defui name & forms)
cljs
(defui &form &env name & forms)
source (clj)source (cljs)

defui*clj/s

(defui* name form)
(defui* name forms env)
source

defui*-cljclj

(defui*-clj name forms)
source

depthclj/s

(depth component)

PRIVATE: Returns the render depth (a integer) of the component relative to the mount root.

PRIVATE: Returns the render depth (a integer) of the component relative to
the mount root.
sourceraw docstring

dispatchclj/s

(dispatch _ key _)

Helper function for implementing :read and :mutate as multimethods. Use this as the dispatch-fn.

Helper function for implementing :read and :mutate as multimethods. Use this
as the dispatch-fn.
sourceraw docstring

factoryclj/s

(factory class)
(factory class
         {:keys [validator keyfn instrument?] :or {instrument? true} :as opts})

Create a factory constructor from a component class created with om.next/defui.

Create a factory constructor from a component class created with
om.next/defui.
source (clj)source (cljs)raw docstring

focus-queryclj/s

(focus-query query path)

Given a query, focus it along the specified path.

Examples: (om.next/focus-query [:foo :bar :baz] [:foo]) => [:foo]

(om.next/focus-query [{:foo [:bar :baz]} :woz] [:foo :bar]) => [{:foo [:bar]}]

Given a query, focus it along the specified path.

Examples:
  (om.next/focus-query [:foo :bar :baz] [:foo])
  => [:foo]

  (om.next/focus-query [{:foo [:bar :baz]} :woz] [:foo :bar])
  => [{:foo [:bar]}]
sourceraw docstring

forceclj/s

(force expr)
(force expr target)

Given a query expression return an equivalent query expression that can be spliced into a transaction that will force a read of that key from the specified remote target.

Given a query expression return an equivalent query expression that can be
spliced into a transaction that will force a read of that key from the
specified remote target.
sourceraw docstring

force-root-render!clj/s

(force-root-render! reconciler)

Force a re-render of the root. Not recommended for anything except recomputing :shared.

Force a re-render of the root. Not recommended for anything except
recomputing :shared.
sourceraw docstring

from-historyclj/s

(from-history reconciler uuid)

Given a reconciler and UUID return the application state snapshost from history associated with the UUID. The size of the reconciler history may be configured by the :history option when constructing the reconciler.

Given a reconciler and UUID return the application state snapshost
from history associated with the UUID. The size of the reconciler history
may be configured by the :history option when constructing the reconciler.
sourceraw docstring

full-queryclj/s

(full-query component)
(full-query component query)

Returns the absolute query for a given component, not relative like om.next/get-query.

Returns the absolute query for a given component, not relative like
om.next/get-query.
sourceraw docstring

gather-sendsclj/s

(gather-sends {:keys [parser] :as env} q remotes)

Given an environment, a query and a set of remotes return a hash map of remotes mapped to the query specific to that remote.

Given an environment, a query and a set of remotes return a hash map of remotes
mapped to the query specific to that remote.
sourceraw docstring

get-computedclj/s

(get-computed x)
(get-computed x k-or-ks)

Return the computed properties on a component or its props.

Return the computed properties on a component or its props.
sourceraw docstring

get-identclj/s

(get-ident x)

Given a mounted component with assigned props, return the ident for the component.

Given a mounted component with assigned props, return the ident for the
component.
sourceraw docstring

get-indexerclj/s

(get-indexer reconciler)

PRIVATE: Get the indexer associated with the reconciler.

PRIVATE: Get the indexer associated with the reconciler.
sourceraw docstring

get-paramsclj/s

(get-params component)

Return the query params for a component.

Return the query params for a component.
sourceraw docstring

get-queryclj/s

(get-query x)

Return a IQuery/IParams instance bound query. Works for component classes and component instances. See also om.next/full-query.

Return a IQuery/IParams instance bound query. Works for component classes
and component instances. See also om.next/full-query.
sourceraw docstring

get-reconcilerclj/s

(get-reconciler c)
source

get-rendered-stateclj/s

(get-rendered-state component)
(get-rendered-state component k-or-ks)

Get the rendered state of component. om.next/get-state always returns the up-to-date state.

Get the rendered state of component. om.next/get-state always returns the
up-to-date state.
sourceraw docstring

get-stateclj/s

(get-state component)
(get-state component k-or-ks)

Get a component's local state. May provide a single key or a sequential collection of keys for indexed access into the component's local state.

Get a component's local state. May provide a single key or a sequential
collection of keys for indexed access into the component's local state.
sourceraw docstring

get-unbound-queryclj/s

(get-unbound-query component)

Return the unbound query for a component.

Return the unbound query for a component.
sourceraw docstring

Identclj/s≠protocol

identclj/s

(ident this props)

Return the ident for this component

Return the ident for this component
source

ILocalStateclj/s≠protocol

-get-rendered-stateclj/s

(-get-rendered-state this)

Get the component's rendered local state

Get the component's rendered local state

-get-stateclj/s

(-get-state this)

Get the component's local state

Get the component's local state

-merge-pending-state!clj/s

(-merge-pending-state! this)

Get the component's pending local state

Get the component's pending local state

-set-state!clj/s

(-set-state! this new-state)

Set the component's local state

Set the component's local state
source

indexerclj/s

(indexer)
(indexer extfs)

Given a function (Component -> Ref), return an indexer.

Given a function (Component -> Ref), return an indexer.
sourceraw docstring

Indexercljs

source

instrumentclj/s

(instrument component)
source

invariantclj/smacro

(invariant condition message)
source (clj)source (cljs)

invariant*clj/s

(invariant* condition message env)
source

IQueryclj/s≠protocol

queryclj/s

(query this)

Return the component's unbound query

Return the component's unbound query
source

iquery?clj/s

(iquery? x)
source

IQueryParamsclj/s≠protocol

paramsclj/s

(params this)

Return the query parameters

Return the query parameters
source

ITxInterceptclj/s≠protocol

tx-interceptclj/s

(tx-intercept c tx)

An optional protocol that component may implement to intercept child transactions.

An optional protocol that component may implement to intercept child
transactions.
source

lifecycle-sigsclj/s

source

merge!clj/s

(merge! reconciler delta)
(merge! reconciler delta query)
(merge! reconciler delta query remote)

Merge a state delta into the application state. Affected components managed by the reconciler will re-render.

Merge a state delta into the application state. Affected components managed
by the reconciler will re-render.
sourceraw docstring

mounted?clj/s

(mounted? x)

Returns true if the component is mounted.

Returns true if the component is mounted.
sourceraw docstring

nil-or-map?clj/s

(nil-or-map? x)
source

parserclj/s

(parser {:keys [read mutate] :as opts})

Create a parser. The argument is a map of two keys, :read and :mutate. Both functions should have the signature (Env -> Key -> Params -> ParseResult).

Create a parser. The argument is a map of two keys, :read and :mutate. Both
functions should have the signature (Env -> Key -> Params -> ParseResult).
sourceraw docstring

process-rootsclj/s

(process-roots query)
source

propsclj/s≠

(props component)
cljs

Return a components props.

Return a components props.
source (clj)source (cljs)raw docstring

query->astclj/s

(query->ast query-expr)

Given a query expression convert it into an AST.

Given a query expression convert it into an AST.
sourceraw docstring

react-keyclj/s

(react-key component)

Returns the components React key.

Returns the components React key.
sourceraw docstring

react-refclj/s

(react-ref component name)

Returns the component associated with a component's React ref.

Returns the component associated with a component's React ref.
sourceraw docstring

react-set-state!clj/s

(react-set-state! component new-state)
(react-set-state! component new-state cb)
source

react-typeclj/s≠

clj
(react-type component)
cljs
(react-type x)

Returns the component type, regardless of whether the component has been mounted

Returns the component type, regardless of whether the component has been
mounted
source (clj)source (cljs)raw docstring

readerclj/s

(reader)
(reader opts)

Create a Om Next transit reader. This reader can handler the tempid type. Can pass transit reader customization opts map.

Create a Om Next transit reader. This reader can handler the tempid type.
Can pass transit reader customization opts map.
sourceraw docstring

Reconcilercljs

source

reconcilerclj/s≠

clj
(reconciler
  {:keys [state shared shared-fn parser indexer ui->props normalize send
          merge-sends remotes merge merge-tree merge-ident prune-tree optimize
          history root-render root-unmount pathopt migrate id-key instrument
          tx-listen easy-reads]
   :or {root-render (fn [c target] c)
        prune-tree default-extract-errors
        pathopt false
        merge-sends (fn* [p1__3241# p2__3242#]
                         (merge-with into p1__3241# p2__3242#))
        merge-ident default-merge-ident
        remotes [:remote]
        migrate default-migrate
        easy-reads true
        history 100
        merge default-merge
        ui->props default-ui->props
        indexer om.next/indexer
        root-unmount (fn [x])
        merge-tree default-merge-tree
        optimize (fn [cs] (sort-by depth cs))}
   :as config})
cljs
(reconciler
  {:keys [state shared shared-fn parser indexer ui->props normalize send
          merge-sends remotes merge merge-tree merge-ident prune-tree optimize
          history root-render root-unmount pathopt migrate id-key instrument
          tx-listen easy-reads]
   :or {root-render (fn* [p1__4007# p2__4008#]
                         (js/ReactDOM.render p1__4007# p2__4008#))
        prune-tree default-extract-errors
        pathopt false
        merge-sends (fn* [p1__4005# p2__4006#]
                         (merge-with into p1__4005# p2__4006#))
        merge-ident default-merge-ident
        remotes [:remote]
        migrate default-migrate
        easy-reads true
        history 100
        merge default-merge
        ui->props default-ui->props
        indexer om.next/indexer
        root-unmount (fn* [p1__4009#]
                          (js/ReactDOM.unmountComponentAtNode p1__4009#))
        merge-tree default-merge-tree
        optimize (fn [cs] (sort-by depth cs))}
   :as config})

Construct a reconciler from a configuration map.

Required parameters: :state - the application state. If IAtom value is not supplied the data will be normalized into the default database format using the root query. This can be disabled by explicitly setting the optional :normalize parameter to false. :parser - the parser to be used

Optional parameters: :shared - a map of global shared properties for the component tree. :shared-fn - a function to compute global shared properties from the root props. the result is merged with :shared. :send - required only if the parser will return a non-empty value when run against the supplied :remotes. send is a function of two arguments, the map of remote expressions keyed by remote target and a callback which should be invoked with the result from each remote target. Note this means the callback can be invoked multiple times to support parallel fetching and incremental loading if desired. The callback should take the response as the first argument and the the query that was sent as the second argument. :normalize - whether the state should be normalized. If true it is assumed all novelty introduced into the system will also need normalization. :remotes - a vector of keywords representing remote services which can evaluate query expressions. Defaults to [:remote] :root-render - the root render function. Defaults to ReactDOM.render :root-unmount - the root unmount function. Defaults to ReactDOM.unmountComponentAtNode :logger - supply a goog.log compatible logger :tx-listen - a function of 2 arguments that will listen to transactions. The first argument is the parser's env map also containing the old and new state. The second argument is a map containing the transaction, its result and the remote sends that the transaction originated.

Construct a reconciler from a configuration map.

Required parameters:
  :state        - the application state. If IAtom value is not supplied the
                  data will be normalized into the default database format
                  using the root query. This can be disabled by explicitly
                  setting the optional :normalize parameter to false.
  :parser       - the parser to be used

Optional parameters:
  :shared       - a map of global shared properties for the component tree.
  :shared-fn    - a function to compute global shared properties from the root props.
                  the result is merged with :shared.
  :send         - required only if the parser will return a non-empty value when
                  run against the supplied :remotes. send is a function of two
                  arguments, the map of remote expressions keyed by remote target
                  and a callback which should be invoked with the result from each
                  remote target. Note this means the callback can be invoked
                  multiple times to support parallel fetching and incremental
                  loading if desired. The callback should take the response as the
                  first argument and the the query that was sent as the second
                  argument.
  :normalize    - whether the state should be normalized. If true it is assumed
                  all novelty introduced into the system will also need
                  normalization.
  :remotes      - a vector of keywords representing remote services which can
                  evaluate query expressions. Defaults to [:remote]
  :root-render  - the root render function. Defaults to ReactDOM.render
  :root-unmount - the root unmount function. Defaults to
                  ReactDOM.unmountComponentAtNode
  :logger       - supply a goog.log compatible logger
  :tx-listen    - a function of 2 arguments that will listen to transactions.
                  The first argument is the parser's env map also containing
                  the old and new state. The second argument is a map containing
                  the transaction, its result and the remote sends that the
                  transaction originated.
sourceraw docstring

reconciler?clj/s

(reconciler? x)

Returns true if x is a reconciler.

Returns true if x is a reconciler.
sourceraw docstring

reduce-query-depthclj/s

(reduce-query-depth q k)

Changes a join on key k with depth limit from [:a {:k n}] to [:a {:k (dec n)}]

Changes a join on key k with depth limit from [:a {:k n}] to [:a {:k (dec n)}]
sourceraw docstring

ref->anyclj/s

(ref->any x ref)

Get any component from the indexer that matches the ref.

Get any component from the indexer that matches the ref.
sourceraw docstring

ref->componentsclj/s

(ref->components x ref)

Return all components for a given ref.

Return all components for a given ref.
sourceraw docstring

remove-root!clj/s

(remove-root! reconciler target)

Remove a root target (a DOM element) from a reconciler. The reconciler will no longer attempt to reconcile application state with the specified root.

Remove a root target (a DOM element) from a reconciler. The reconciler will
no longer attempt to reconcile application state with the specified root.
sourceraw docstring

reshapeclj/s

(reshape dt {:keys [reshape defaults]})
source

reshape-mapclj/s

source

reshape-map-cljclj

source

rewriteclj/s

(rewrite rewrite-map result)
source

schedule-render!clj/s≠

clj
cljs
(schedule-render! reconciler)
source (clj)source (cljs)

schedule-sends!clj/s

(schedule-sends! reconciler)
source

set-query!clj/s

(set-query! x params&query)
(set-query! x {:keys [params query]} reads)

Change the query of a component. Takes a map containing :params and/or :query. :params should be a map of new bindings and :query should be a query expression. Will schedule a re-render as well as remote re-sends if necessary.

Change the query of a component. Takes a map containing :params and/or
:query. :params should be a map of new bindings and :query should be a query
expression. Will schedule a re-render as well as remote re-sends if
necessary.
sourceraw docstring

set-state!clj/s≠

(set-state! component new-state)
cljs

Set the component local state of the component. Analogous to React's setState.

Set the component local state of the component. Analogous to React's
setState.
source (clj)source (cljs)raw docstring

sharedclj/s

(shared component)
(shared component k-or-ks)

Return the global shared properties of the Om Next root. See :shared and :shared-fn reconciler options.

Return the global shared properties of the Om Next root. See :shared and
:shared-fn reconciler options.
sourceraw docstring

should-update?cljs

(should-update? c next-props)
(should-update? c next-props next-state)
source

some-iquery?clj/s

(some-iquery? c)
source

subqueryclj/s

(subquery x subquery-ref subquery-class)

Given a class or mounted component x and a ref to an instantiated component or class that defines a subquery, pick the most specific subquery. If the component is mounted subquery-ref will be used, subquery-class otherwise.

Given a class or mounted component x and a ref to an instantiated component
or class that defines a subquery, pick the most specific subquery. If the
component is mounted subquery-ref will be used, subquery-class otherwise.
sourceraw docstring

tagclj/s

(tag x class)
source

tempidclj/s

(tempid)
(tempid id)

Return a temporary id.

Return a temporary id.
sourceraw docstring

tempid?clj/s

(tempid? x)

Return true if x is a tempid, false otherwise

Return true if x is a tempid, false otherwise
sourceraw docstring

transact!clj/s

(transact! x tx)
(transact! r ref tx)

Given a reconciler or component run a transaction. tx is a parse expression that should include mutations followed by any necessary read. The reads will be used to trigger component re-rendering.

Example:

(om/transact! widget '[(do/this!) (do/that!) :read/this :read/that])

Given a reconciler or component run a transaction. tx is a parse expression
that should include mutations followed by any necessary read. The reads will
be used to trigger component re-rendering.

Example:

  (om/transact! widget
    '[(do/this!) (do/that!)
      :read/this :read/that])
sourceraw docstring

transact*clj/s

(transact* r c ref tx)
source

transform-readsclj/s

(transform-reads r tx)

Given r (a reconciler) and a query expression including a mutation and any simple reads, return the equivalent query expression where the simple reads have been replaced by the full query for each component that cares about the specified read.

Given r (a reconciler) and a query expression including a mutation and
any simple reads, return the equivalent query expression where the simple
reads have been replaced by the full query for each component that cares about
the specified read.
sourceraw docstring

tree->dbclj/s

(tree->db x data)
(tree->db x data merge-idents)

Given a Om component class or instance and a tree of data, use the component's query to transform the tree into the default database format. All nodes that can be mapped via Ident implementations wil be replaced with ident links. The original node data will be moved into tables indexed by ident. If merge-idents option is true, will return these tables in the result instead of as metadata.

Given a Om component class or instance and a tree of data, use the component's
query to transform the tree into the default database format. All nodes that
can be mapped via Ident implementations wil be replaced with ident links. The
original node data will be moved into tables indexed by ident. If merge-idents
option is true, will return these tables in the result instead of as metadata.
sourceraw docstring

uiclj/s≠macro

clj
(ui & forms)
cljs
(ui &form &env & forms)
source (clj)source (cljs)

update-query!clj/s

(update-query! component f)
(update-query! component f arg0)
(update-query! component f arg0 arg1)
(update-query! component f arg0 arg1 arg2)
(update-query! component f arg0 arg1 arg2 arg3 & arg-rest)

Update a component's query and query parameters with a function.

Update a component's query and query parameters with a function.
sourceraw docstring

update-state!clj/s

(update-state! component f)
(update-state! component f arg0)
(update-state! component f arg0 arg1)
(update-state! component f arg0 arg1 arg2)
(update-state! component f arg0 arg1 arg2 arg3)
(update-state! component f arg0 arg1 arg2 arg3 & arg-rest)

Update a component's local state. Similar to Clojure(Script)'s swap!

Update a component's local state. Similar to Clojure(Script)'s swap!
sourceraw docstring

validate-sigclj/s

(validate-sig [name sig :as method])
source

writerclj/s

(writer)
(writer opts)

Create a Om Next transit writer. This writer can handler the tempid type. Can pass transit writer customization opts map.

Create a Om Next transit writer. This writer can handler the tempid type.
Can pass transit writer customization opts map.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close