The implementation of processing load/mutation result graph targeting.
The implementation of processing load/mutation result graph targeting.
(append-to target)
Specifies a to-many target that will append an edge to some to-many edge. NOTE: this kind of target will not create duplicates in the target list.
target
- A vector (path) in the normalized database of the to-many list of idents.
Specifies a to-many target that will append an edge to some to-many edge. NOTE: this kind of target will not create duplicates in the target list. `target` - A vector (path) in the normalized database of the to-many list of idents.
(integrate-ident* state ident & named-parameters)
Integrate an ident into any number of places in the app state. This function is safe to use within mutation implementations as a general helper function.
The named parameters can be specified any number of times. They are:
NOTE: ident
does not have to be an ident if you want to place denormalized data. It can really be anything.
Returns the updated state map.
Integrate an ident into any number of places in the app state. This function is safe to use within mutation implementations as a general helper function. The named parameters can be specified any number of times. They are: - append: A vector (path) to a list in your app state where this new object's ident should be appended. Will not append the ident if that ident is already in the list. - prepend: A vector (path) to a list in your app state where this new object's ident should be prepended. Will not place the ident if that ident is already in the list. - replace: A vector (path) to a specific location in app-state where this object's ident should be placed. Can target a to-one or to-many. If the target is a vector element then that element must already exist in the vector. NOTE: `ident` does not have to be an ident if you want to place denormalized data. It can really be anything. Returns the updated state map.
(multiple-targets & targets)
Specifies a target that should place edges in the graph at multiple locations.
targets
- Any number of targets. A target can be a simple path (as a vector), or other
special targets like append-to
and prepend-to
.
Specifies a target that should place edges in the graph at multiple locations. `targets` - Any number of targets. A target can be a simple path (as a vector), or other special targets like `append-to` and `prepend-to`.
(prepend-to target)
Specifies a to-many target that will preprend an edge to some to-many edge. NOTE: this kind of target will not create duplicates in the target list.
target
- A vector (path) in the normalized database of the to-many list of idents.
Specifies a to-many target that will preprend an edge to some to-many edge. NOTE: this kind of target will not create duplicates in the target list. `target` - A vector (path) in the normalized database of the to-many list of idents.
(process-target state-map source-path target)
(process-target state-map source-path target remove-source?)
Process a load target (which can be a multiple-target).
state-map
- the state-map
source-path
- A keyword, ident, or app-state path. If the source path is an ident, then that is what is placed
in app state. If it is a keyword or longer path then the thing at that location in app state is pulled from app state
and copied to the target location(s).
target
- The target(s)
remove-source?
- When true the source will be removed from app state once it has been written to the new location.
Returns an updated state-map with the given changes.
Process a load target (which can be a multiple-target). `state-map` - the state-map `source-path` - A keyword, ident, or app-state path. If the source path is an ident, then that is what is placed in app state. If it is a keyword or longer path then the thing at that location in app state is pulled from app state and copied to the target location(s). `target` - The target(s) `remove-source?` - When true the source will be removed from app state once it has been written to the new location. Returns an updated state-map with the given changes.
(replace-at target)
Specifies a target that will replace an edge at some normalized location.
target
- A vector (path) in the normalized database. This path can include numbers to target some element
of an existing to-many list of idents.
Specifies a target that will replace an edge at some normalized location. `target` - A vector (path) in the normalized database. This path can include numbers to target some element of an existing to-many list of idents.
(special-target? target)
Is the given target special? This means it is not just a plain vector path, but is instead something like an append.
Is the given target special? This means it is not just a plain vector path, but is instead something like an append.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close