Liking cljdoc? Tell your friends :D

fulcro.client.impl.data-fetch


append-target?clj/s

(append-target? t)

callback-envclj/s

(callback-env reconciler load-request original-env)

Build a callback env for post mutations and fallbacks

Build a callback env for post mutations and fallbacks
raw docstring

data-fieldclj/s

(data-field state)

Get the target field (if any) from the data state marker

Get the target field (if any) from the data state marker
raw docstring

data-identclj/s

(data-ident state)

Return the ident (if any) of the component related to the query in the data state marker. An ident is required to be present if the marker is targeting a field.

Return the ident (if any) of the component related to the query in the data state marker. An ident is required
to be present if the marker is targeting a field.
raw docstring

data-markerclj/s

(data-marker state)

Returns the ID of the data marker, or nil/false if there isn't one. True means to use the old marker behavior of replacing the data in app state with a marker (DEPRECATED)

Returns the ID of the data marker, or nil/false if there isn't one. True means to use the old marker behavior of
replacing the data in app state with a marker (DEPRECATED)
raw docstring

data-marker?clj/s

(data-marker? state)

Test if the user desires a copy of the state marker to appear in the app state at the data path of the target data.

Test if the user desires a copy of the state marker to appear in the app state at the data path of the target data.
raw docstring

data-paramsclj/s

(data-params state)

Get the parameters that the user wants to add to the first join/keyword of the data fetch query.

Get the parameters that the user wants to add to the first join/keyword of the data fetch query.
raw docstring

data-pathclj/s

(data-path state)

Get the app-state database path of the target of the load that the given data state marker is trying to load.

Get the app-state database path of the target of the load that the given data state marker is trying to load.
raw docstring

data-queryclj/s

(data-query state)

Get the query that will be sent to the server as a result of the given data state marker

Get the query that will be sent to the server as a result of the given data state marker
raw docstring

data-query-keyclj/s

(data-query-key state)

Get the 'primary' query key of the data fetch. This is defined as the first keyword of the overall query (which might be a simple prop or join key for example)

Get the 'primary' query key of the data fetch. This is defined as the first keyword of the overall query (which might
be a simple prop or join key for example)
raw docstring

data-refreshclj/s

(data-refresh state)

Get the list of query keywords that should be refreshed (re-rendered) when this load completes.

Get the list of query keywords that should be refreshed (re-rendered) when this load completes.
raw docstring

data-remoteclj/s

(data-remote state)

Get the remote that this marker is meant to talk to

Get the remote that this marker is meant to talk to
raw docstring

data-state?clj/s

(data-state? state)

Test if the given bit of state is a data fetch state-tracking marker

Test if the given bit of state is a data fetch state-tracking marker
raw docstring

data-targetclj/s

(data-target state)

Return the ident (if any) of the component related to the query in the data state marker. An ident is required to be present if the marker is targeting a field.

Return the ident (if any) of the component related to the query in the data state marker. An ident is required
to be present if the marker is targeting a field.
raw docstring

data-uuidclj/s

(data-uuid state)

Get the UUID of the data fetch

Get the UUID of the data fetch
raw docstring

dedupe-byclj/s

(dedupe-by keys-fn)
(dedupe-by keys-fn coll)

Returns a lazy sequence of the elements of coll with dupes removed. An element is a duplicate IFF (keys-fn element) has key collision with any prior element to come before it. E.g. (dedupe-by identity [[:a] [:b] [:a] [:a :c]]) => [[:a] [:b]] Returns a stateful transducer when no collection is provided.

Returns a lazy sequence of the elements of coll with dupes removed.
An element is a duplicate IFF (keys-fn element) has key collision with any prior element
to come before it. E.g. (dedupe-by identity [[:a] [:b] [:a] [:a :c]]) => [[:a] [:b]]
Returns a stateful transducer when no collection is provided.
raw docstring

earliest-load-timeclj/s

(earliest-load-time load-markers)

Given a sequence of load markers, returns the history tx-time of the earliest one. Returns hist/max-tx-time if there are no markers or none have a time.

Given a sequence of load markers, returns the history tx-time of the earliest one. Returns hist/max-tx-time if there
are no markers or none have a time.
raw docstring

elide-ast-nodesclj/s

(elide-ast-nodes {:keys [key union-key children] :as ast} elision-set)

Remove items from a query (AST) that have a key listed in the elision-set

Remove items from a query (AST) that have a key listed in the elision-set
raw docstring

failed?clj/s

(failed? state)

Test if the given item is a data state marker in the failed state

Test if the given item is a data state marker in the failed state
raw docstring

full-queryclj/s

(full-query items)

Composes together the queries of a sequence of data states into a single query.

Composes together the queries of a sequence of data states into a single query.
raw docstring

inject-query-paramsclj/s

(inject-query-params ast params)

Inject parameters into elements of the top-level query.

params is a map from keyword (on the query in the AST) to parameter maps. So, given the AST for this query:

[:a :b :c]

and a params of {:a {:x 1} :c {:y 2}} you'll get an AST representing:

[(:a {:x 1}) :b (:c {:y 2})]
Inject parameters into elements of the top-level query.

`params` is a map from keyword (on the query in the AST) to parameter maps. So, given the AST for this query:

```
[:a :b :c]
```

and a `params` of `{:a {:x 1} :c {:y 2}}` you'll get an AST representing:

```
[(:a {:x 1}) :b (:c {:y 2})]
```
raw docstring

is-deferred-transaction?clj/s

(is-deferred-transaction? query)

Returns true if the outgoing query is just a placeholder indicator for a deferred transaction in the load queue.

Returns true if the outgoing query is just a placeholder indicator for a deferred transaction in the load queue.
raw docstring

is-direct-table-load?clj/s

(is-direct-table-load? load-marker)

loading?clj/s

(loading? state)

Test if the given item is a data state marker in the loading state

Test if the given item is a data state marker in the loading state
raw docstring

make-data-stateclj/s

(make-data-state type)
(make-data-state type params)

This is just a testing function -- using ready-state as public interface and call the set-{type}! functions to change it as needed.

This is just a testing function -- using ready-state as public interface and call the
`set-{type}!` functions to change it as needed.
raw docstring

mark-loadingclj/s

(mark-loading remote reconciler)

Marks all of the items in the ready-to-load state as loading, places the loading markers in the appropriate locations in the app state, and returns a map with the keys:

query : The full query to send to the server. on-load : The function to call to merge a response. Detects missing data and sets failure markers for those. on-error : The function to call to set network/server error(s) in place of loading markers. load-descriptors : Args to pass back to on-load and on-error. These are separated so that rewrite-tempids-in-request-queue can rewrite tempids for merge and error callbacks

response-channel will have the response posted to it when the request is done. .

Marks all of the items in the ready-to-load state as loading, places the loading markers in the appropriate locations
in the app state, and returns a map with the keys:

`query` : The full query to send to the server.
`on-load` : The function to call to merge a response. Detects missing data and sets failure markers for those.
`on-error` : The function to call to set network/server error(s) in place of loading markers.
`load-descriptors` : Args to pass back to on-load and on-error. These are separated
  so that `rewrite-tempids-in-request-queue` can rewrite tempids for merge and
  error callbacks

response-channel will have the response posted to it when the request is done.
.
raw docstring

mark-parallel-loading!clj/s

(mark-parallel-loading! remote-name reconciler)

Marks all of the items in the ready-to-load state as loading, places the loading markers in the appropriate locations in the app state, and return maps with the keys:

query : The full query to send to the server. on-load : The function to call to merge a response. Detects missing data and sets failure markers for those. on-error : The function to call to set network/server error(s) in place of loading markers. load-descriptors : Args to pass back to on-load and on-error. These are separated so that rewrite-tempids-in-request-queue can rewrite tempids for merge and error callbacks

response-channel will have the response posted to it when the request is done. .

Marks all of the items in the ready-to-load state as loading, places the loading markers in the appropriate locations
in the app state, and return maps with the keys:

`query` : The full query to send to the server.
`on-load` : The function to call to merge a response. Detects missing data and sets failure markers for those.
`on-error` : The function to call to set network/server error(s) in place of loading markers.
`load-descriptors` : Args to pass back to on-load and on-error. These are separated
  so that `rewrite-tempids-in-request-queue` can rewrite tempids for merge and
  error callbacks

response-channel will have the response posted to it when the request is done.
.
raw docstring

mark-readyclj/s

(mark-ready {:keys [env] :as config})

Place a ready-to-load marker into the application state. This should be done from a mutate function that is abstractly loading something. This is intended for internal use.

See the load and load-field functions in fulcro.client.data-fetch for the public API.

Place a ready-to-load marker into the application state. This should be done from
a mutate function that is abstractly loading something. This is intended for internal use.

See the `load` and `load-field` functions in `fulcro.client.data-fetch` for the public API.
raw docstring

marker-tableclj/s


multiple-targets?clj/s

(multiple-targets? t)

optionalclj/s

(optional pred)

prepend-target?clj/s

(prepend-target? t)

process-targetclj/s


ready-stateclj/s

(ready-state {:keys [ident field params remote without query post-mutation
                     post-mutation-params fallback parallel refresh marker
                     target env initialize abort-id]
              :or {remote :remote without #{} refresh [] marker true}})

Generate a ready-to-load state with all of the necessary details to do remoting and merging.

Generate a ready-to-load state with all of the necessary details to do
remoting and merging.
raw docstring

ready?clj/s

(ready? state)

Test if the given item is a data state marker that is in the ready state

Test if the given item is a data state marker that is in the ready state
raw docstring

relocate-targeted-results!clj/s

(relocate-targeted-results! state-atom items)

For items that are manually targeted, move them in app state from their result location to their target location.

For items that are manually targeted, move them in app state from their result location to their target location.
raw docstring

replacement-target?clj/s

(replacement-target? t)

set-failed!clj/s

(set-failed! state)
(set-failed! state params)

Returns a marker (based on the input state) that is in the error state

Returns a marker (based on the input state) that is in the error state
raw docstring

set-loading!clj/s

(set-loading! state)
(set-loading! state params)

Returns a marker (based on the input state) that is in the loading state (and ensures that it has a UUID)

Returns a marker (based on the input state) that is in the loading state (and ensures that it has a UUID)
raw docstring

set-ready!clj/s

(set-ready! state)
(set-ready! state params)

Returns a state (based on the input state) that is in the 'ready' to load state.

Returns a state (based on the input state) that is in the 'ready' to load state.
raw docstring

special-target?clj/s

(special-target? t)

split-items-ready-to-loadclj/s

(split-items-ready-to-load items-ready-to-load)

This function is used to split accidental colliding queries into separate network requests. The most general description of this issue is from two unrelated load calls when black-box composing functions. The two separate queries: One issues [{:entitlements [:foo]}], and the other asks for [{:entitlements [:bar]}]. Fulcro merges these into a single query [{:entitlements [:foo]} {:entitlements [:bar]}]. However, the response to a query is a map, and such a query would result in the backend parser being called twice (once per key in the subquery) but one would stomp on the other.

The other potential collision is if a load includes an abort ID. In this case such a load should not be batched with others because aborting it would take others down with it.

Thus, this function ensures such accidental collisions are not combined into a single network request.

This functions returns a list of the load items that can be batched (from the beginning, in order) and the remainder of the items which must be deferred to another request.

This function is used to split accidental colliding queries into separate network
requests. The most general description of this issue is
from two unrelated `load` calls when black-box composing functions. The two
separate queries: One issues `[{:entitlements [:foo]}]`, and the other
asks for `[{:entitlements [:bar]}]`. Fulcro merges these into a single query
[{:entitlements [:foo]} {:entitlements [:bar]}]. However, the response to a query
is a map, and such a query would result in the backend parser being called twice (once per key in the subquery)
but one would stomp on the other.

The other potential collision is if a load includes an abort ID. In this case such a load should not be batched
with others because aborting it would take others down with it.

Thus, this function ensures such accidental collisions are not combined into a single network request.

This functions returns a list of the load items that can be batched (from the beginning, in order) and the
remainder of the items which must be deferred to another request.
raw docstring

valid-typesclj/s

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

× close