Skip to content

Commit f89d509

Browse files
author
Hypercube
committed
readme update
1 parent 72463b6 commit f89d509

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This project demonstrate **how reactive programming is way more simple to implem
4545

4646
### The main idea
4747

48-
The share state is just a tree of objects hosted in a singleton called a store. Any modification on this tree will fire an event inside an event bus. We are going to build this event bus using an Rx [Observable](https://RxJS-dev.firebaseapp.com/guide/observable). You can subscribe to it and unsubscribe from it at any point in time.
48+
The shared state is just a tree of objects hosted in a singleton called a **store**. Any modification on this tree will fire an event inside an event bus. We are going to build this event bus using an Rx [Observable](https://RxJS-dev.firebaseapp.com/guide/observable). You can subscribe to it and unsubscribe from it at any point in time.
4949

5050
The observable is like a stream of events. Each event is just a string saying "the property A.B.C.D in the shared state have changed".
5151

@@ -62,7 +62,7 @@ The beauty of Rx is that you can filter the stream of events before subscribing
6262
observable.pipe(filter(event=>...select what you want...)).subscribe(subscriberCallBack)
6363
```
6464

65-
In the class `GlobalStore` we used this technique in the method `subscribe`.
65+
In the ES6 class `GlobalStore` we use this technique in the method `subscribe`.
6666

6767
- `MyAppStore.subscribe("a.b.c",callback)`: react only on this specific node
6868
- `MyAppStore.subscribe("a.*",callback)`: react to any change on node 'a' and below
@@ -98,14 +98,14 @@ Example:
9898

9999
### Protect the shared state
100100

101-
It would be very dangerous to give a direct reference to the share state to the consumer. Remember we want to keep unidirectional data flow. Here some solutions to this problem:
101+
It would be very dangerous to give a direct reference to the shared state to the consumer. Remember we want to keep unidirectional data flow. Here some solutions to this problem:
102102

103103
- We can clone before delivering the value
104104
- We can use a library that promote immutable data structures like [immutable.js](https://immutable-js.github.io/immutable-js/)
105105

106106
To keep it simple, we opted to clone the value, even it is slow.
107107

108-
## A little of OOP for better encapsulation
108+
## A little bit of OOP for better encapsulation
109109

110110
The ES6 class `GlobalStore` provides the basics of a shared state with an event bus powered by RxJS.
111111

0 commit comments

Comments
 (0)