Skip to content

Commit f4cf811

Browse files
authored
docs: Update README.md
1 parent 2881530 commit f4cf811

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ I'll answer that now, and also give an introduction to Crystalize.js.
9797

9898
## Introduction
9999

100-
Crystalize.js, while it _is_ essentially a reducer, it serves a different purpose. A reducer simply _reduces_ a collection of elements into a single aggregate. But, what Crystalize.js sets out to do is a little bit different. What if you want to keep the collection you passed in? What if you want variable amounts of that collection aggregated, or to be able to rewind to different points of that aggregation to see what it was at that point?
100+
Crystalize.js, while it _is_ essentially a reducer, serves a different purpose. A reducer simply _reduces_ a collection of elements into a single aggregate. But, what Crystalize.js sets out to do is a little bit different. What if you want to keep the collection you passed in? What if you want variable amounts of that collection aggregated, or to be able to rewind to different points of that aggregation to see what it was at that point?
101101

102-
It's fair to consider think of a 'crystal' as an accumulator, and a 'shard' as an element. And that's really what they are. But that doesn't capture the goal of Crystalize.js, either.
102+
It's fair to think of a 'crystal' as an accumulator, and a 'shard' as an element. And that's really what they are. But that doesn't capture the goal of Crystalize.js, either.
103103

104104
They could likewise be called 'state' and 'actions', and that's really what they are, _when Crystalize.js is used in that way_. But, Crystalize.js sets out to serve more use-cases than actions and state.
105105

106-
Thus, the names are chosen to better reflect what Crystalize.js is doing, in verb form. Shards are _crystalized_ into an accumulated state, and the name calls that out to reflect the control and choice you have in how that process takes place.
106+
Thus, the names are chosen to reflect better what Crystalize.js is doing, in verb form. Shards are _crystalized_ into an accumulated state, and the name calls that out to reflect the control and choice you have in how that process takes place.
107107

108108
To illustrate, here's the flow of an action+reducer:
109109

@@ -117,7 +117,7 @@ To illustrate, here's the flow of an action+reducer:
117117
readable
118118
```
119119

120-
You pass actions into the reducer, and then they're aggregated into the accumulator, in this case, your app state. You have your state, which is great, but your action is gone. It cannot be replayed, and timing data about that action is lost, unless you add _additional state_ in order to track that information.
120+
You pass actions into the reducer, and then they're aggregated into the accumulator, in this case, your app state. You have your state, which is great, but your action is gone. It cannot be replayed, and timing data about that action is lost, unless you add _additional state_ to track that information.
121121

122122
Here's the flow of Crystalize.js:
123123

@@ -226,11 +226,11 @@ console.log(shards); // [{ value: 1 }, { value: 3 }];
226226

227227
## Pointers (undo/redo)
228228

229-
Crystalizer's keep an internal pointer to the L'th most recent shard that we are currently interested in. `L` is the amount of shards _left_ inside the crystalizer, and not counted when calling `take()`.
229+
Crystalizer's keep an internal pointer to the L'th most recent shard that we are currently interested in. `L` is the number of shards _left_ inside the crystalizer, and not counted when calling `take()`.
230230

231231
Ordinarily, the pointer is at `0`. To move it to the next most recent shard, we'd set it to `1`. Third most recent, `2`, and so on.
232232

233-
The simplest way to do this is with the `.leave(L)` method, which we'll look at first. If we know a specific shard which we are interested in, we can do that via the `.focus` method, which we'll look at a little later.
233+
The simplest way to do this is with the `.leave(L)` method, which we'll look at first. If we know a specific shard that we are interested in, we can do that via the `.focus` method, which we'll look at a little later.
234234

235235
#### .leave()
236236

@@ -452,11 +452,11 @@ let crystalizer = new Crystalizer<Crystal, Shard>({
452452
});
453453
```
454454

455-
Now, it's handled for us automatically. Notice that in addition to removing from our `map` call, it's not specified as a sort either. When a timestamp key is specified, shards are automatically sorted by that key first, and then everything else after.
455+
Now, it's handled for us automatically. Notice that in addition to removing it from our `map` call, it's not specified as a sort either. When a timestamp key is specified, shards are automatically sorted by that key first, and then everything else after.
456456

457457
### Keep
458458

459-
Remember that when we call `.take(N)`, we can pass in the value `N` which is the number of shards that are NOT collapsed into the base crystal? That's a mouthfull, so let's bring back our earlier diagram:
459+
Remember that when we call `.take(N)`, we can pass in the value `N` which is the number of shards that are NOT collapsed into the base crystal. That's a mouthful, so let's bring back our earlier diagram:
460460

461461
```
462462
┌─┬───────────────┬───┬──────────────────┬────┬────────────────┬─┐

0 commit comments

Comments
 (0)