Add some preliminary docs

This commit is contained in:
Dan Holmsand 2015-02-01 15:29:04 +01:00
parent 83fd1361df
commit 742a8d3575
2 changed files with 16 additions and 0 deletions

View File

@ -3,6 +3,10 @@
## Upcoming
- Reagent no longer bundles React. Instead it uses cljsjs/react as a dependency. This means that you should no longer specify React in `:preamble` in your project.clj.
- `cursor` is re-written, to be more efficient and flexible.
- `render` now forces a deep update of all components, to make it more convenient to use with e.g. figwheel.
- Renamed `as-component` to `as-element`, to match React's new terminology better (old name still works, though, for backward compatiblity).

View File

@ -212,10 +212,22 @@ the specified path within the wrapped Reagent atom. e.g.,
... (reset! c 42) ;; equivalent to (swap! ra assoc-in [:nested :content] 42)
... (swap! c inc) ;; equivalence to (swap! ra update-in [:nested :content] inc)
)
The first parameter can also be a function, that should look something
like this:
(defn digit-filter
([k] (get-in @state k))
([k v] (swap! state assoc-in k v)))
The function will be called with one argument the path passed to
cursor when the cursor is deref'ed, and two arguments (path and new
value) when the cursor is modified.
"
([src path]
(ratom/cursor src path)))
;; Utilities
(defn next-tick