Skip to content
Store abstraction doing time travelling debugger
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cli/build
entry
src/reel
.gitattributes
.gitignore
README.md
calcit.edn
deps.edn
meyvn.edn
package.json
shadow-cljs.edn
yarn.lock

README.md

Reel: state management library for Respo

as a time traveling debugger. This is exprimental technology.

Built as actions-in-recorder.

Demo http://repo.respo-mvc.org/reel/

Usage

Clojars Project

[respo/reel "0.3.4"]

"shortid" from npm is on dependency list, make sure it's installed.

Browse src/reel/main.cljs to see how to use it.

Functions you need from namespaces:

[reel.util :refer [listen-devtools!]]
[reel.core :refer [reel-updater refresh-reel]]
[reel.schema :as reel-schema]

Notice that store now lives inside reel map.

Instead of *store, you need *reel for global states. For example:

(def store {:states {} :tasks (list)})

(defonce *reel
  (atom (-> reel-schema/reel
            (assoc :base store)
            (assoc :store store))))

And we need a reel-updater besides the familiar updater we used in Respo:

(defn dispatch! [op op-data]
  (let [new-reel (reel-updater updater @*reel op op-data)]
    (reset! *reel new-reel)))

Make sure you watch *reel and initialize reel.core/*code inside main! function:

(add-watch *reel :changes (fn [] (render-app! render!)))

Call handle-reload! with so many arguments to reload store and element caches:

(defn reload! []
  (clear-cache!)
  (reset! *reel (refresh-reel @*reel schema/store updater)))

To use records panel, please refer to comp-reel:

(comp-reel reel styles)

Listening to Command Shift a to launch DevTools:

(listen-devtools! "a" dispatch!)

Develop

Workflow https://github.com/mvc-works/calcit-workflow

License

MIT

You can’t perform that action at this time.