Skip to content

Instantly share code, notes, and snippets.

@victorvoid
Last active February 10, 2017 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save victorvoid/2e394418287f31d70e632f51a507d088 to your computer and use it in GitHub Desktop.
Save victorvoid/2e394418287f31d70e632f51a507d088 to your computer and use it in GitHub Desktop.
(re-frame/reg-event-db
:request-success-repositories
(fn [db [_ response]]
(.log js/console (:items response)) ;;; <-- I want to get it but is returning 'null'.
(assoc db :repositories-search-list response)))
(re-frame/reg-event-db
:request-search
(fn
[db [_ query-params]]
(GET
"https://api.github.com/search/repositories?q=teste"
{
:handler #(re-frame/dispatch [:request-success-repositories %1])
:error-handler #(js/console.log (str "error :/" %1))})))
;; my app-bd: (success!)
;; :repositories-search-list {"total_count" 2
;; "items " {...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment