Better pagination behavior on filter change.
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
(re-frame/reg-event-db
|
||||
::dispose
|
||||
(fn [db [_ id]]
|
||||
(println "TABLE" (::table-params db) (::table-params (update db ::table-params dissoc id)))
|
||||
(-> db
|
||||
(update ::data dissoc id)
|
||||
(update ::checked dissoc id)
|
||||
@@ -132,7 +133,9 @@
|
||||
(re-frame/reg-event-fx
|
||||
::filters-settled
|
||||
(fn [{:keys [db]} [_ id]]
|
||||
{:db (assoc-in db [::settled-filters id] @(re-frame/subscribe [::filters id]))}))
|
||||
{:db (-> db
|
||||
(assoc-in [::settled-filters id] @(re-frame/subscribe [::filters id]))
|
||||
(update-in [::table-params id ] dissoc :start))}))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::settled-filters
|
||||
@@ -146,7 +149,8 @@
|
||||
[which val] (if (= 3 (count params))
|
||||
[(into [a] b) c]
|
||||
[[a] b])]
|
||||
{:db (assoc-in db (into [::filters id] which) val)
|
||||
{:db (-> db
|
||||
(assoc-in (into [::filters id] which) val))
|
||||
:dispatch-debounce
|
||||
{:event [::filters-settled id]
|
||||
:time 800
|
||||
|
||||
Reference in New Issue
Block a user