-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callback event should also be given all the input arguments #89
Comments
Even better, It would be nice if it was able to add any arguments to the callback. Kinda like currying the event (re-frame/reg-event-db
::on-thing
[re-frame/unwrap]
(fn [db [user-id user {:keys [response]}]]
(let [{:keys [data errors]} response]
;; do things with data e.g. write it into the re-frame database
)))
(re-frame/dispatch [::re-graph/subscribe
{:id :my-subscription-id
:query "{ things { id } }"
:variables {:some "variable"}
:callback [::on-thing 10 {:username "user" :role "admin"}]}]) What do you think? This would unfortunately break the current functionality, but I think it's a nice addition. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's now given a map with
:response
key populated, but it might be nice if it also had:id
,:query
,:variables
etc as well, this could potentially save the user piping this stuff around if they need it in the callback handlerThe text was updated successfully, but these errors were encountered: