(add-or-update-by-id-event kw id-fn add-alt? db [_ item])
(multi-generation gen-fn & params)
Applies a generation function to each parameter passed through, up to a variable amount.
(multi-generation reg-basic-sub :cow :wolf :dog :cat) ; => registers four subscriptions, :get-cow, :get-wolf, :get-dog :get-cat
Applies a generation function to each parameter passed through, up to a variable amount. (multi-generation reg-basic-sub :cow :wolf :dog :cat) ; => registers four subscriptions, :get-cow, :get-wolf, :get-dog :get-cat
(reg-add-event event-kw kw)
Registers an update event to the db that preforms a conj
(reg-add-event :add-kw :kw) (reg-add-event :add-kw [:kw1 :kw2])
You would call the event as follows, passing through one item to conj
(dispatch [:add-kw my-item])
Note: there is no one-arity version of this function.
Registers an update event to the db that preforms a conj (reg-add-event :add-kw :kw) (reg-add-event :add-kw [:kw1 :kw2]) You would call the event as follows, passing through one item to conj (dispatch [:add-kw my-item]) Note: there is no one-arity version of this function.
(reg-add-or-update-by-id-event event-kw kw)
(reg-add-or-update-by-id-event id-fn event-kw kw)
Registers an update event to the db that performs a conj or replace depending on whether an item can be found in the collection. Makes assumptions on being able to the find the id of each item in the collection.
(reg-add-or-update-by-id-event :add-or-update-kw :kw) (reg-add-or-update-by-id-event :id :add-or-update-kw :kw) => Both of the above examples assume the :kw collection has items that all contain the :id identifier
You would call the event with the item passed through, e.g.
(dispatch [:add-or-update-kw item])
Registers an update event to the db that performs a conj or replace depending on whether an item can be found in the collection. Makes assumptions on being able to the find the id of each item in the collection. (reg-add-or-update-by-id-event :add-or-update-kw :kw) (reg-add-or-update-by-id-event :id :add-or-update-kw :kw) => Both of the above examples assume the :kw collection has items that all contain the :id identifier You would call the event with the item passed through, e.g. (dispatch [:add-or-update-kw item])
(reg-ajax-delete-event uri
event-kw
kw
id-fn
&
[{:keys [on-success db-fn on-error]
:or {on-success :reframe-utils/basic-delete-success
db-fn default-db-handler}}])
(reg-ajax-get-event uri kw)
(reg-ajax-get-event uri
get-event-kw
kw
&
[{:keys [on-success db-fn on-error]
:or {on-success :reframe-utils/basic-get-success
db-fn default-db-handler}}])
Registers an ajax get event that assoc-in the result to the db. If no get- keyword passed, appends get- to the keyword.
(reg-ajax-get-event "/api/request-call" :data) (reg-ajax-get-event "/api/request-call" :get-data :data)
Registers an ajax get event that assoc-in the result to the db. If no get- keyword passed, appends get- to the keyword. (reg-ajax-get-event "/api/request-call" :data) (reg-ajax-get-event "/api/request-call" :get-data :data)
(reg-ajax-post-event uri
post-event-kw
kw
&
[{:keys [on-success db-fn on-error]
:or {on-success :reframe-utils/basic-add-success
db-fn default-db-handler}}])
Registers an ajax post event that applies an update-in and conj of the result to the db
Registers an ajax post event that applies an update-in and conj of the result to the db
(reg-ajax-put-event uri
put-event-kw
kw
id-fn
&
[{:keys [on-success db-fn on-error]
:or {on-success :reframe-utils/basic-update-success
db-fn default-db-handler}}])
Registers an ajax put event that applies an update-in and update of the result to the db. Assumes there is a unique identifier for items manipulated here
Registers an ajax put event that applies an update-in and update of the result to the db. Assumes there is a unique identifier for items manipulated here
(reg-basic-sub k)
(reg-basic-sub name k)
(reg-basic-sub name k sort-fn)
Registers a 'get' subscription from the re-frame db.
(reg-basic-sub :sub-name :kw-to-get) (reg-basic-sub :sub-name [:kw-to-get1 :kw-to-get2])
Using the one-arity version of this function will append 'get' as a prefix to the keyword for the name of the sub. For example (reg-basic-sub :best-ns/my-sub) registers a subscription named :best-ns/get-my-sub and returns :best-ns/my-sub from the db
Registers a 'get' subscription from the re-frame db. (reg-basic-sub :sub-name :kw-to-get) (reg-basic-sub :sub-name [:kw-to-get1 :kw-to-get2]) Using the one-arity version of this function will append 'get' as a prefix to the keyword for the name of the sub. For example (reg-basic-sub :best-ns/my-sub) registers a subscription named :best-ns/get-my-sub and returns :best-ns/my-sub from the db
(reg-remove-event event-kw kw)
Registers an update event to the db that performs a remove-when.
(reg-remove-event :remove-kw :kw) (reg-remove-event :remove-kw [:kw1 :kw2])
Remove-when is a helper function that calls remove on a collection and is true when any item in the collection equals the item to test against.
You would call the event as follows, passing through one item, the one that you are removing from the collection.
(dispatch [:remove-kw item])
Note: there is no one-arity version of this function.
Registers an update event to the db that performs a remove-when. (reg-remove-event :remove-kw :kw) (reg-remove-event :remove-kw [:kw1 :kw2]) Remove-when is a helper function that calls remove on a collection and is true when any item in the collection equals the item to test against. You would call the event as follows, passing through one item, the one that you are removing from the collection. (dispatch [:remove-kw item]) Note: there is no one-arity version of this function.
(reg-set-event k)
(reg-set-event event-kw kw)
Registers a 'set' associative event.
(reg-set-event :event-name :kw-to-set) (reg-set-event :event-name [:kw-to-set1 :kw-to-set2])
Using the one-arity version of this function will append 'set' as a prefix to the keyword for the name of the revent. For example (reg-set-event :best-ns/my-kw) registers an event named :best-ns/set-my-kw that, when called, associates a value to :best-ns/my-kw db.
As with other re-frame events you would call these through any form of the dispatch, e.g. (dispatch [:best-ns/set-my-kw [1 2 3 4]])
Registers a 'set' associative event. (reg-set-event :event-name :kw-to-set) (reg-set-event :event-name [:kw-to-set1 :kw-to-set2]) Using the one-arity version of this function will append 'set' as a prefix to the keyword for the name of the revent. For example (reg-set-event :best-ns/my-kw) registers an event named :best-ns/set-my-kw that, when called, associates a value to :best-ns/my-kw db. As with other re-frame events you would call these through any form of the dispatch, e.g. (dispatch [:best-ns/set-my-kw [1 2 3 4]])
(reg-sub-by-id k)
(reg-sub-by-id name k)
(reg-sub-by-id name k id-key)
(reg-update-by-id-event event-kw kw)
(reg-update-by-id-event id-fn event-kw kw)
Registers an update event to the db that performs a replace with assumptions that each item in the collection operated on has an id and that it will find/update the one item whose unique id matches.
(reg-update-by-id-event :update-kw :kw) (reg-update-by-id-event :id :update-kw :kw) => Both of the above examples assume the :kw collection has items that all contain the :id identifier
You would call the event with the new item passed through, e.g.
(dispatch [:update-kw new-item])
Registers an update event to the db that performs a replace with assumptions that each item in the collection operated on has an id and that it will find/update the one item whose unique id matches. (reg-update-by-id-event :update-kw :kw) (reg-update-by-id-event :id :update-kw :kw) => Both of the above examples assume the :kw collection has items that all contain the :id identifier You would call the event with the new item passed through, e.g. (dispatch [:update-kw new-item])
(reg-update-event event-kw kw)
Registers an update event to the db that preforms a replace
(reg-update-event :update-kw :kw) (reg-update-event :update-kw [:kw1 :kw2])
You would call the event as follows, passing through two items, the old item to replace, and the new one to replace it with
(dispatch [:update-kw old-item new-item])
Note: there is no one-arity version of this function.
Registers an update event to the db that preforms a replace (reg-update-event :update-kw :kw) (reg-update-event :update-kw [:kw1 :kw2]) You would call the event as follows, passing through two items, the old item to replace, and the new one to replace it with (dispatch [:update-kw old-item new-item]) Note: there is no one-arity version of this function.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close