Skip to content

Instantly share code, notes, and snippets.

@cyberoctopi
Created June 19, 2018 03:13
Show Gist options
  • Select an option

  • Save cyberoctopi/0f7a0424bcc01b9e6e1433896b22893e to your computer and use it in GitHub Desktop.

Select an option

Save cyberoctopi/0f7a0424bcc01b9e6e1433896b22893e to your computer and use it in GitHub Desktop.
(ns d-c.events
(:require [d-c.db :as db]
[re-frame.core :refer [dispatch reg-event-db reg-event-fx reg-sub]]
[ajax.core :refer [GET POST PUT]]))
;;dispatchers
(reg-event-db
:initialize-db
(fn [_ _]
db/default-db))
(reg-event-db
:set-active-panel
(fn [db [_ active-panel]]
(assoc db :active-panel active-panel)))
(reg-event-fx
:create-user
(fn [_ [_ user]]
{:http {:method POST
:url "/register"
:ajax-map {:params user}}}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment