Skip to content

Commit a920d01

Browse files
committed
Merge pull request #132 from bhamodi/master
General Documentation Cleanup
2 parents c816191 + d0d967a commit a920d01

20 files changed

+55
-58
lines changed

CHANGELOG.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
#### `Reactor#serialize()`
1010

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)`.
1212

1313
```js
1414
reactor.loadState(reactor.serialize())
1515
```
1616

1717
#### `Reactor#loadState( state )`
1818

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`
2020

2121
This can be useful if you need to load data already on the page.
2222

@@ -29,7 +29,7 @@ reactor.loadState({
2929

3030
#### `Store#serialize`
3131

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.
3333
This is overridable for your specific data needs.
3434

3535
```js
@@ -48,7 +48,7 @@ Nuclear.Store({
4848

4949
#### `Store#deserialize`
5050

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.
5252
This is overridable for your specific data needs.
5353

5454
```js
@@ -79,7 +79,7 @@ Nuclear.Store({
7979

8080
## 1.0.1 (April 27, 2015)
8181

82-
- **[NEW]** Expose `createReactMixin` functionality on Nuclear singleton.
82+
- **[NEW]** Expose `createReactMixin` functionality on NuclearJS singleton.
8383
- **[FIXED]** Fix `new Store()` from throwing error when not passed a config object.
8484

8585
## 1.0.0 (April 25, 2015)

docs/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# NuclearJS Docs
22

3-
Doc site statically generated using `React` + `NuclearJS`.
3+
Documentation site statically generated using `React` + `NuclearJS`.
44

5-
##### For development
5+
### For development
66

77
```sh
88
grunt dev
99
```
1010

11-
##### To deploy to gh-pages
11+
### To deploy to gh-pages
1212

1313
```sh
1414
grunt publish

docs/TODO.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Documentation site todo
1+
# Documentation site TODO List
22

33
- [x] links to docs, API, github
44
- [x] build pipeline for docs from MD files
@@ -8,3 +8,4 @@
88
- [ ] scaffold design patterns/examples area
99
- [ ] mobile side navbar
1010
- [ ] build pipeline for examples, create example component, possibly with code editing
11+
- [ ] add active state to Docs side bar. (currently doesn't show which tab is active/selected)

docs/grunt/build-site.js

-2
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ function parseDocs(globPattern, opts, cb) {
112112
})
113113
}
114114

115-
116115
// Util Functions
117-
118116
function filenameOnly(filepath) {
119117
return path.basename(filepath, path.extname(filepath))
120118
}

docs/src/components/doc-sidebar.js

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { BASE_URL } from '../globals'
44
export default React.createClass({
55
//propTypes: {
66
//navStructure: React.PropTypes.objectOf(React.PropTypes.shape({
7-
8-
97
//}))
108
//},
119

docs/src/components/usage-example.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ var item0Price = reactor.evaluate(['items', 0, 'price'])
102102
// Evaluate by getter
103103
var filteredItems = reactor.evaluate(filteredItemsGetter)
104104
105-
// Evaluate and coerce to plain javascript
105+
// Evaluate and coerce to plain JavaScript
106106
var itemsPOJO = reactor.evaluateToJS(filteredItemsGetter)
107107
108108
// Observation
@@ -140,7 +140,7 @@ export default React.createClass({
140140
</p>
141141

142142
<p>
143-
<code>initialize()</code> - Sets up any action handlers, by specifying the action type and a function that transforms
143+
<code>initialize()</code> - Sets up any action handlers, by specifying the action type and a function that transforms
144144
<pre><code>(storeState, action) => (newStoreState)</code></pre>
145145
</p>
146146
</div>
@@ -213,15 +213,15 @@ export default React.createClass({
213213
</h3>
214214

215215
<p>
216-
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>.
217217
</p>
218218

219219
<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.
221221
</p>
222222

223223
<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.
225225
</p>
226226
</div>
227227
</div>
@@ -239,7 +239,7 @@ export default React.createClass({
239239
</h3>
240240

241241
<p>
242-
Nuclear also provides imperative mechanisms for evaluating and observing state.
242+
NuclearJS also provides imperative mechanisms for evaluating and observing state.
243243
</p>
244244

245245
<p>

docs/src/docs/01-getting-started.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ npm install --save nuclear-js
1717

1818
## Overview
1919

20-
In this tutorial we'll create a Nuclear flux system to show a list of products and add them to a shopping cart. Here's the plan:
20+
In this tutorial we'll create a NuclearJS flux system to show a list of products and add them to a shopping cart. Here's the plan:
2121

2222
1. Create a **Reactor**
2323

@@ -33,19 +33,19 @@ In this tutorial we'll create a Nuclear flux system to show a list of products a
3333

3434
1. Although the example code is written using ES6, this is totally optional. NuclearJS fully supports ES5 out of the box.
3535

36-
2. Nuclear stores work best when using ImmutableJS data structures. You will see `toImmutable` quite often, this is simply sugar
36+
2. NuclearJS stores work best when using ImmutableJS data structures. You will see `toImmutable` quite often, this is simply sugar
3737
to convert plain JavaScript arrays into [`Immutable.List`](https://facebook.github.io/immutable-js/docs/#/List) and objects to
3838
[`Immutable.Map`](https://facebook.github.io/immutable-js/docs/#/Map). The use of `toImmutable` is optional, you are free to use
3939
any ImmutableJS data structure with no penalty.
4040

4141

4242
## Creating a `Reactor`
4343

44-
To get started, we'll create a Nuclear `Reactor`. In Nuclear, the `Reactor` is the brains of the system and in some ways analogous
44+
To get started, we'll create a NuclearJS `Reactor`. In Nuclear, the `Reactor` is the brains of the system and in some ways analogous
4545
to the traditional Flux `dispatcher` (though it works differently under the hood and provides a few extra features, which we'll
4646
cover later).
4747

48-
Generally you'll only have one reactor for your application, however they are instanceable for server-side rendering.
48+
Generally you'll only have one reactor for your application, however they are instance-able for server-side rendering.
4949

5050
The reactor has two main jobs:
5151

@@ -67,7 +67,7 @@ export default reactor
6767
```
6868

6969
_* If you pass a `debug: true` option when instantiating a reactor, you'll get great debugging tools that print to your browser console.
70-
This is completely optional, but very useful for keeping tracking of dispatched actions and subsequest changes in state._
70+
This is completely optional, but very useful for keeping tracking of dispatched actions and subsequent changes in state._
7171

7272
Now that we have our reactor, let's create some actions.
7373

docs/src/docs/02-creating-actions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ We've now created two actions that we can use to send data into the system.
6060

6161
While synchronous actions are great, often you'll need to perform an asynchronous operation before dispatching an action. Nuclear
6262
fully supports creating actions asynchronously, as we're doing in `fetchProducts`. This is a common pattern you'll use as your application grows,
63-
and Nuclear has no opinion on how you perform your operations: callbacks, Promises, Generators, ES7 async functions — they'll all work just fine!
63+
and NuclearJS has no opinion on how you perform your operations: callbacks, Promises, Generators, ES7 async functions — they'll all work just fine!
6464

6565
If you'd like to jump ahead, you can read more about [async actions](./04-async-actions-and-optimistic-updates.html).
6666

docs/src/docs/03-creating-stores.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ In Flux, stores are used for managing application state, but they don't represen
99

1010
More than simply managing ORM-style objects, **stores manage the state for a particular domain within the application**.
1111

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.
1313

1414
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
1515
actions a store will respond to by attaching handlers.
@@ -23,7 +23,7 @@ handler(currentState: any, payload: any)
2323

2424
In Nuclear, state can only be an ImmutableJS data type, such as an `Immutable.Map` or an `Immutable.List`, or a JavaScript primitive.
2525

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
2727
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
2828
of existing or transformed application state. The responsibility of reading application state falls on **Getters**, which we'll cover later.
2929

@@ -224,7 +224,7 @@ However, if stores are limited in scope, how can you read substantive data from
224224

225225
It's actually quite simple: **composition**.
226226

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:
228228

229229
```javascript
230230
reactor.evaluate([

docs/src/docs/05-hooking-up-to-react.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ section: "Guide"
77

88
### Binding application state to components
99

10-
Every Nuclear Reactor comes with `reactor.ReactMixin` to easily create an always-in-sync binding between any KeyPath or Getter value
10+
Every NuclearJS Reactor comes with `reactor.ReactMixin` to easily create an always-in-sync binding between any KeyPath or Getter value
1111
and a React component's state.
1212

1313
The ability to observe any piece of composite data is immensely powerful and trivializes a lot of what other frameworks work hard to solve.
1414

1515
To use simply include the `reactor.ReactMixin` and implement the `getDataBindings()` function that returns an object of state properties
16-
to `KeyPath` or `Getter`. Nuclear will take care of the initial sync, observation and destroying the subscription when on `componentWillUnmount`.
16+
to `KeyPath` or `Getter`. NuclearJS will take care of the initial sync, observation and destroying the subscription when on `componentWillUnmount`.
1717

1818
**First let's expand our main file to initiate the fetch for products.**
1919

@@ -140,9 +140,9 @@ export default React.createClass({
140140

141141
## Recap
142142

143-
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.
144144

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
146146
have to explicitly call `this.setState` to re-render a component.
147147

148148
In the next section we will cover hooking up actions to our react components.

docs/src/docs/06-async-actions-and-optimistic-updates.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ This ends our getting started example, for a more in depth look all of the above
163163
For additional documentation and resources checkout the following:
164164

165165
- [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.
168168

169169
More coming soon...

docs/src/docs/07-api.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ reactor.observe([
8989
9090
_added in 1.1_
9191
92-
Returns a plain javascript object representing the application state. By defualt this maps over all stores and returns `toJS(storeState)`.
92+
Returns a plain JavaScript object representing the application state. By default this maps over all stores and returns `toJS(storeState)`.
9393
9494
```javascript
9595
reactor.loadState(reactor.serialize())
@@ -99,7 +99,7 @@ reactor.loadState(reactor.serialize())
9999
100100
_added in 1.1_
101101
102-
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`
103103
104104
This can be useful if you need to load data already on the page.
105105
@@ -201,7 +201,7 @@ Responsible for setting up action handlers for the store using `this.on(actionTy
201201
202202
_added in 1.1_
203203
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.
205205
This is overridable for your specific data needs.
206206
207207
```javascript
@@ -222,7 +222,7 @@ Nuclear.Store({
222222
223223
_added in 1.1_
224224
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.
226226
This is overridable for your specific data needs.
227227
228228
```javascript

docs/src/docs/99-core-concepts.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ section: "Guide"
55

66
## Core Concepts
77

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.
99

1010
Each entry in this top level map contains a portion of the entire app state for a specific domain and are managed by **stores**.
1111

12-
Imagine modelling a shopping cart. Our app state would look like:
12+
Imagine modeling a shopping cart. Our app state would look like:
1313

1414
```javascript
1515
{
@@ -31,7 +31,7 @@ live in our app state because those are all examples of **computable state**, an
3131

3232
#### Reactor
3333

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.
3535

3636
#### Stores
3737

@@ -80,9 +80,9 @@ var totalGetter = [
8080
]
8181
```
8282

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.
8484

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.
8686

8787
__For the astute reader__ - You probably already noticed if you have experience in functional languages, but because Getters
8888
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({
260260
mixins: [reactor.ReactMixin],
261261

262262
// simply implement this function to keep a component's state
263-
// in sync with a Nuclear Reactor
263+
// in sync with a NuclearJS Reactor
264264
getDataBindings() {
265265
return {
266266
// can reference a reactor KeyPath

docs/src/pages/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default React.createClass({
4242
</p>
4343

4444
<h3 className="tour-section--bullet-title">
45-
Powerful functional dataflow
45+
Powerful functional dataflow
4646
</h3>
4747
<p className="tour-section--bullet-item">
4848
Compose and transform your data together statelessly and efficiently using a functional lens concept called <strong>Getters</strong>.
@@ -58,7 +58,7 @@ export default React.createClass({
5858
Any Getter can be observed by a view to be notified whenever its derived value changes.
5959
</p>
6060
<p className="tour-section--bullet-item">
61-
Nuclear includes tools to integrate with libraries such as React and VueJS out of the box.
61+
NuclearJS includes tools to integrate with libraries such as React and VueJS out of the box.
6262
</p>
6363

6464
<h3 className="tour-section--bullet-title">
@@ -68,7 +68,7 @@ export default React.createClass({
6868
Thanks to immutable data, change detection can be efficiently performed at any level of granularity by a constant time reference equality <code>(===)</code> check.
6969
</p>
7070
<p className="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.
7272
</p>
7373
</div>
7474
</div>

0 commit comments

Comments
 (0)