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
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@
8
8
9
9
#### `Reactor#serialize()`
10
10
11
-
Returns a plain javascript object representing the application state. By defualt this maps over all stores and returns `toJS(storeState)`.
11
+
Returns a plain JavaScript object representing the application state. By default this maps over all stores and returns `toJS(storeState)`.
12
12
13
13
```js
14
14
reactor.loadState(reactor.serialize())
15
15
```
16
16
17
17
#### `Reactor#loadState( state )`
18
18
19
-
Takes a plain javascript object and merges into the reactor state, using `store.deserialize`
19
+
Takes a plain JavaScript object and merges into the reactor state, using `store.deserialize`
20
20
21
21
This can be useful if you need to load data already on the page.
22
22
@@ -29,7 +29,7 @@ reactor.loadState({
29
29
30
30
#### `Store#serialize`
31
31
32
-
Serialization method for the store's data, by default its implemented as `Nuclear.toJS' which converts ImmutableJS objects to plain javascript.
32
+
Serialization method for the store's data, by default its implemented as `Nuclear.toJS' which converts ImmutableJS objects to plain JavaScript.
33
33
This is overridable for your specific data needs.
34
34
35
35
```js
@@ -48,7 +48,7 @@ Nuclear.Store({
48
48
49
49
#### `Store#deserialize`
50
50
51
-
Serialization method for the store's data, by default its implemented as `Nuclear.toImmutable' which converts plain javascript objects to ImmutableJS data structures.
51
+
Serialization method for the store's data, by default its implemented as `Nuclear.toImmutable' which converts plain JavaScript objects to ImmutableJS data structures.
52
52
This is overridable for your specific data needs.
53
53
54
54
```js
@@ -79,7 +79,7 @@ Nuclear.Store({
79
79
80
80
## 1.0.1 (April 27, 2015)
81
81
82
-
-**[NEW]** Expose `createReactMixin` functionality on Nuclear singleton.
82
+
-**[NEW]** Expose `createReactMixin` functionality on NuclearJS singleton.
83
83
-**[FIXED]** Fix `new Store()` from throwing error when not passed a config object.
Nuclear maintains a very non-magical approach to dispatching actions. Simply call <code>reactor.dispatch</code> with the <code>actionType</code> and <code>payload</code>.
216
+
NuclearJS maintains a very non-magical approach to dispatching actions. Simply call <code>reactor.dispatch</code> with the <code>actionType</code> and <code>payload</code>.
217
217
</p>
218
218
219
219
<p>
220
-
All action handling is done synchronously, leaving the state of the system very predicatable after every action.
220
+
All action handling is done synchronously, leaving the state of the system very predictable after every action.
221
221
</p>
222
222
223
223
<p>
224
-
Because actions are simply functions, it is very easy to compose actions together using plain javascript.
224
+
Because actions are simply functions, it is very easy to compose actions together using plain JavaScript.
Copy file name to clipboardExpand all lines: docs/src/docs/03-creating-stores.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ In Flux, stores are used for managing application state, but they don't represen
9
9
10
10
More than simply managing ORM-style objects, **stores manage the state for a particular domain within the application**.
11
11
12
-
Unlike many other Flux libraries, Nuclear stores hold no state. Instead, they provide a collection of functions that transform current state into new state.
12
+
Unlike many other Flux libraries, NuclearJS stores hold no state. Instead, they provide a collection of functions that transform current state into new state.
13
13
14
14
Stores provide a `getInitialState` method, which returns the initial state value that a store will manage, and an `initialize` hook, which is used to define what
15
15
actions a store will respond to by attaching handlers.
In Nuclear, state can only be an ImmutableJS data type, such as an `Immutable.Map` or an `Immutable.List`, or a JavaScript primitive.
25
25
26
-
Because stores in Nuclear don't hold state — they simply receive state, transform it, and return new state — there is no need to worry about stores knowing
26
+
Because stores in NuclearJS don't hold state — they simply receive state, transform it, and return new state — there is no need to worry about stores knowing
27
27
about other stores. That means no confusing `store.waitsFor` and no cross-pollution of data. In Nuclear, the sole responsibility of a store is to return a portion
28
28
of existing or transformed application state. The responsibility of reading application state falls on **Getters**, which we'll cover later.
29
29
@@ -224,7 +224,7 @@ However, if stores are limited in scope, how can you read substantive data from
224
224
225
225
It's actually quite simple: **composition**.
226
226
227
-
Nuclear allows you to combine data from stores in a non-destructive manner, check it out:
227
+
NuclearJS allows you to combine data from stores in a non-destructive manner, check it out:
Once you have a functioning Nuclear Reactor, hooking it up to a React application is very easy using the `reactor.ReactMixin` + `getDataBindings()` method.
143
+
Once you have a functioning NuclearJS Reactor, hooking it up to a React application is very easy using the `reactor.ReactMixin` + `getDataBindings()` method.
144
144
145
-
Nuclear will automatically sync the value of a getter to your component via `this.setState` whenever the underlying getter value changes. Meaning you never
145
+
NuclearJS will automatically sync the value of a getter to your component via `this.setState` whenever the underlying getter value changes. Meaning you never
146
146
have to explicitly call `this.setState` to re-render a component.
147
147
148
148
In the next section we will cover hooking up actions to our react components.
Copy file name to clipboardExpand all lines: docs/src/docs/06-async-actions-and-optimistic-updates.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -163,7 +163,7 @@ This ends our getting started example, for a more in depth look all of the above
163
163
For additional documentation and resources checkout the following:
164
164
165
165
-[API Documentation](./07-api.html)
166
-
-[Flux Chat Example](https://github.com/optimizely/nuclear-js/tree/master/examples/flux-chat) - classic facebook flux chat example written in NuclearJS
167
-
-[Rest API Example](https://github.com/optimizely/nuclear-js/tree/master/examples/rest-api) - shows how to deal with fetching data from an API using NuclearJS conventions
166
+
-[Flux Chat Example](https://github.com/optimizely/nuclear-js/tree/master/examples/flux-chat) - A classic Facebook flux chat example written in NuclearJS.
167
+
-[Rest API Example](https://github.com/optimizely/nuclear-js/tree/master/examples/rest-api) - Shows how to deal with fetching data from an API using NuclearJS conventions.
Takes a plain javascript object and merges into the reactor state, using `store.deserialize`
102
+
Takes a plain JavaScript object and merges into the reactor state, using `store.deserialize`
103
103
104
104
This can be useful if you need to load data already on the page.
105
105
@@ -201,7 +201,7 @@ Responsible for setting up action handlers for the store using `this.on(actionTy
201
201
202
202
_added in 1.1_
203
203
204
-
Serialization method for the store's data, by default its implemented as `Nuclear.toJS' which converts ImmutableJS objects to plain javascript.
204
+
Serialization method for the store's data, by default its implemented as `Nuclear.toJS' which converts ImmutableJS objects to plain JavaScript.
205
205
This is overridable for your specific data needs.
206
206
207
207
```javascript
@@ -222,7 +222,7 @@ Nuclear.Store({
222
222
223
223
_added in 1.1_
224
224
225
-
Serialization method for the store's data, by default its implemented as `Nuclear.toImmutable' which converts plain javascript objects to ImmutableJS data structures.
225
+
Serialization method for the store's data, by default its implemented as `Nuclear.toImmutable' which converts plain JavaScript objects to ImmutableJS data structures.
Copy file name to clipboardExpand all lines: docs/src/docs/99-core-concepts.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ section: "Guide"
5
5
6
6
## Core Concepts
7
7
8
-
The easiest way to think about how NuclearJS is modelling the state of your system is to imagine it all as a single map (or JavaScript object). If you are familiar with Om then the concept of a singular App State is very familiar already.
8
+
The easiest way to think about how NuclearJS is modeling the state of your system is to imagine it all as a single map (or JavaScript object). If you are familiar with Om then the concept of a singular App State is very familiar already.
9
9
10
10
Each entry in this top level map contains a portion of the entire app state for a specific domain and are managed by **stores**.
11
11
12
-
Imagine modelling a shopping cart. Our app state would look like:
12
+
Imagine modeling a shopping cart. Our app state would look like:
13
13
14
14
```javascript
15
15
{
@@ -31,7 +31,7 @@ live in our app state because those are all examples of **computable state**, an
31
31
32
32
#### Reactor
33
33
34
-
In Nuclear a Reactor is the container that holds your app state, it's where you register stores, dispatch actions and read the current state of your system. Reactor's are the only stateful part of Nuclear and have only 3 API methods you REALLY need to know: `dispatch`, `get`, and `observe`. Don't worry, extensive API docs will be provided for all of these methods.
34
+
In NuclearJS a Reactor is the container that holds your app state, it's where you register stores, dispatch actions and read the current state of your system. Reactor's are the only stateful part of NuclearJS and have only 3 API methods you REALLY need to know: `dispatch`, `get`, and `observe`. Don't worry, extensive API docs will be provided for all of these methods.
35
35
36
36
#### Stores
37
37
@@ -80,9 +80,9 @@ var totalGetter = [
80
80
]
81
81
```
82
82
83
-
Notice that you can use getters as dependencies to other getters. This is an extremely powerful abstraction, and one that you'll undoubtedly want to become familiar with in your nuclear journey.
83
+
Notice that you can use getters as dependencies to other getters. This is an extremely powerful abstraction, and one that you'll undoubtedly want to become familiar with in your NuclearJS journey.
84
84
85
-
But you need to know one thing about getter transform functions - they MUST be pure functions (that is, a given set input values results in a [deterministic](https://en.wikipedia.org/wiki/Deterministic_algorithm) output). By making the transform functions pure, you can test Getters easier, compose them easier, and nuclear can [memoize](https://en.wikipedia.org/wiki/Memoization) calls to them, making Getter dependency resolution very performant.
85
+
But you need to know one thing about getter transform functions - they MUST be pure functions (that is, a given set input values results in a [deterministic](https://en.wikipedia.org/wiki/Deterministic_algorithm) output). By making the transform functions pure, you can test Getters easier, compose them easier, and NuclearJS can [memoize](https://en.wikipedia.org/wiki/Memoization) calls to them, making Getter dependency resolution very efficient.
86
86
87
87
__For the astute reader__ - You probably already noticed if you have experience in functional languages, but because Getters
88
88
are simply arrays full of strings and pure functions, they are serializable. Since JS can stringify pure functions, your getters are nothing more than data that could be stored, sent over the wire, etc.
@@ -260,7 +260,7 @@ var ShoppingCart = React.createClass({
260
260
mixins: [reactor.ReactMixin],
261
261
262
262
// simply implement this function to keep a component's state
Thanks to immutable data, change detection can be efficiently performed at any level of granularity by a constant time reference equality <code>(===)</code> check.
69
69
</p>
70
70
<pclassName="tour-section--bullet-item">
71
-
Since Getters use pure functions, Nuclear utilizes memoization to only recompute parts of the dataflow that might change.
71
+
Since Getters use pure functions, NuclearJS utilizes memoization to only recompute parts of the dataflow that might change.
0 commit comments