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: README.md
+11-23Lines changed: 11 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
### This POC has multiple goals:
4
4
1. Be able to define an algebra which will describe a subdomain of our business logic.
5
5
2. Provide a definition for the algebra.
6
-
3. Connect algebra to a react redux application.
6
+
3. Connect the algebra to a react redux application.
7
7
8
8
## 1. Defining the algebra
9
9
We are starting by defining a class which should describe our problem.
@@ -40,7 +40,7 @@ class CallAlgebra<Customer, Agent, Call> {
40
40
}
41
41
```
42
42
43
-
As you see we are keeping our pure and monadic, so we are able to chain our methods to build larger and more complex logic.
43
+
As you see we are keeping our algebra pure and monadic, so we are able to chain our methods to build larger and more complex logic. For this example we are using funfix/effects but any IO implementation that support sync and async execution should work.
44
44
45
45
```typescript
46
46
classCallAlgebra<Customer, Agent, Call> {
@@ -65,7 +65,7 @@ Now we have every piece to build our algebra, try play with this idea a bit and
65
65
66
66
## 2. Provide a definition for the algebra
67
67
68
-
Now that we have a ready algebra we are ready to create an implementation for it (in FP word its called interpreter)
68
+
Now that we have an algebra we are ready to create an implementation for it (in FP word its called interpreter)
69
69
70
70
It is made of 2 sub steps. First we need to define our types for our algebras params and then we need to pass our methods implementation:
## 3. Connect the algebra to a react redux application.
152
152
Because the IO monad is lazy and referentially transparent we can store its state in redux.
153
153
To make this work we need 2 reducers. One for the IO and the other one for the result of the IO.
154
154
@@ -228,20 +228,24 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
228
228
229
229
In the project directory, you can run:
230
230
231
-
###`yarn start`
231
+
*`yarn start`
232
232
233
233
Runs the app in the development mode.<br />
234
234
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
235
235
236
236
The page will reload if you make edits.<br />
237
237
You will also see any lint errors in the console.
238
238
239
-
### `yarn test`
239
+
*`yarn mock-server`
240
+
241
+
Starts a mock server
242
+
243
+
*`yarn test`
240
244
241
245
Launches the test runner in the interactive watch mode.<br />
242
246
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
243
247
244
-
###`yarn build`
248
+
*`yarn build`
245
249
246
250
Builds the app for production to the `build` folder.<br />
247
251
It correctly bundles React in production mode and optimizes the build for the best performance.
@@ -250,19 +254,3 @@ The build is minified and the filenames include the hashes.<br />
250
254
Your app is ready to be deployed!
251
255
252
256
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
253
-
254
-
### `yarn eject`
255
-
256
-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
257
-
258
-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
259
-
260
-
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
261
-
262
-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
263
-
264
-
## Learn More
265
-
266
-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
267
-
268
-
To learn React, check out the [React documentation](https://reactjs.org/).
0 commit comments