You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 28, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+19-7
Original file line number
Diff line number
Diff line change
@@ -224,16 +224,16 @@ Each component in Rum has state associated with it. State is just a CLJS map wit
224
224
225
225
*`:rum/react-component` — link to React component/element object
226
226
*`:rum/id` — unique component id
227
-
* everything mixins are using for they internal bookkeeping
228
-
* anything your own code put here
227
+
* everything mixins are using for their internal bookkeeping
228
+
* anything you’ve put there (feel free to populate state with your own stuff!)
229
229
230
-
Reference to current state is stored as `volatile!` boxed value at `props[":rum/state"]`.
230
+
Reference to current state is stored as `volatile!` boxed value at `state[":rum/state"]`.
231
231
Effectively state is mutable, but components do not change volatile reference directly,
232
232
instead all lifecycle functions accept and return state value.
233
233
234
234
Classes define component behavior, including render function. Class is built from multiple mixins.
235
235
236
-
Mixins are basic building blocks for designing new components behaviors in Rum. Each mixin is just a map of one or more of following functions and maps:
236
+
Mixins are basic building blocks for designing new components behaviors in Rum. Each mixin is just a map of one or more of following functions:
237
237
238
238
```clojure
239
239
{ :init;; state, props ⇒ state
@@ -246,9 +246,14 @@ Mixins are basic building blocks for designing new components behaviors in Rum.
Imagine a class built from N mixins. When lifecycle event happens in React (e.g. `componentDidMount`), all `:did-mount` functions from first mixin to last will be invoked one after another, threading current state value through them. State returned from last `:did-mount` mixin will be stored in volatile state reference by Rum. Similarly, `context` maps from multiple mixins are combined into one map.
@@ -323,6 +328,13 @@ This is a detailed breakdown of what happens inside of Rum. By using `rum/defc`,
323
328
324
329
## Changes
325
330
331
+
### 0.3.0
332
+
333
+
- [ BREAKING ] Component inner state (`:rum/state`) was moved from props to state. It doesn’t change a thing if you were using only Rum API, but might break something if you were relaying on internal details
334
+
- Upgraded to React 0.13.3, Sablono 0.3.6, ClojueScript 1.7.48
335
+
- Added `defcc` macro forwhen you only need React component, but not the whole Rum state
336
+
- Deprecated `rum/with-props` macro, use `rum/with-key` or `rum/with-ref` fns instead
337
+
326
338
### 0.2.7
327
339
328
340
- Allow components to refer to themselves (thx [Kevin Lynagh](https://github.com/lynaghk), pull request #30)
0 commit comments