2015-06-18 12:35:50 -05:00
|
|
|
(ns uxbox.state
|
|
|
|
(:require [uxbox.rstore :as rs]
|
|
|
|
[beicon.core :as rx]))
|
|
|
|
|
2015-12-13 15:57:14 -05:00
|
|
|
(enable-console-print!)
|
|
|
|
|
|
|
|
(defonce state (atom {}))
|
|
|
|
|
2015-12-14 07:17:18 -05:00
|
|
|
(defonce stream
|
2015-12-13 15:57:14 -05:00
|
|
|
(rs/init {:user {:fullname "Cirilla"
|
|
|
|
:avatar "http://lorempixel.com/50/50/"}
|
2015-12-14 13:31:21 -05:00
|
|
|
:workspace nil
|
2015-12-14 07:17:18 -05:00
|
|
|
:projects []
|
|
|
|
:pages []
|
2015-12-13 06:04:34 -05:00
|
|
|
:projects-by-id {}
|
|
|
|
:pages-by-id {}}))
|
2015-06-18 12:35:50 -05:00
|
|
|
|
2015-12-14 07:17:18 -05:00
|
|
|
(defonce +setup-stuff+
|
|
|
|
(do
|
2015-12-14 13:31:21 -05:00
|
|
|
(rx/to-atom stream state)
|
|
|
|
(rx/on-value stream #(println "state:" %))))
|
2015-12-14 07:17:18 -05:00
|
|
|
|