Functions for making and consuming Fulcro temporary IDs.
Functions for making and consuming Fulcro temporary IDs.
(resolve-tempids data-structure tid->rid)
Replaces all tempids in data-structure
using the tid->rid
map. This is just a deep
walk that replaces every possible match of tid
with rid
.
tid->rid
must be a map, as this function optimizes away resolution by checking if
the map is empty.
Returns the data structure with everything replaced.
Replaces all tempids in `data-structure` using the `tid->rid` map. This is just a deep walk that replaces every possible match of `tid` with `rid`. `tid->rid` must be a map, as this function optimizes away resolution by checking if the map is empty. Returns the data structure with everything replaced.
(resolve-tempids! {:com.fulcrologic.fulcro.application/keys [state-atom
runtime-atom]}
tx-result)
Resolve all of the mutation tempid remappings in the tx-result
against the given app
.
app - The fulcro app tx-result - The transaction result (the body map, not the internal tx node).
This function rewrites all tempids in the app state and runtime transaction queues.
NOTE: This function assumes that tempids are distinctly recognizable (e.g. are TempIds or guids). It is unsafe to use this function if you're using something else for temporary IDs as this function might rewrite things that are not IDs.
Resolve all of the mutation tempid remappings in the `tx-result` against the given `app`. app - The fulcro app tx-result - The transaction result (the body map, not the internal tx node). This function rewrites all tempids in the app state and runtime transaction queues. NOTE: This function assumes that tempids are distinctly recognizable (e.g. are TempIds or guids). It is unsafe to use this function if you're using something else for temporary IDs as this function might rewrite things that are not IDs.
(result->tempid->realid tx-result)
Find and combine all of the tempid remappings from a standard fulcro transaction response.
Find and combine all of the tempid remappings from a standard fulcro transaction response.
(tempid)
(tempid uuid)
(tempid)
(tempid id)
Create a new tempid.
Create a new tempid.
(tempid? x)
Returns true if the given x
is a tempid.
Returns true if the given `x` is a tempid.
(uuid)
(uuid n)
(uuid)
(uuid & args)
Generate a UUID. With no args returns a random UUID. with an arg (numeric) it generates a stable one based on that number (useful for testing). Works in cljc.
Generate a UUID. With no args returns a random UUID. with an arg (numeric) it generates a stable one based on that number (useful for testing). Works in cljc.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close