Skip to content

Commit 90b3b93

Browse files
committed
update tuts
1 parent b3ba781 commit 90b3b93

File tree

6 files changed

+27
-14
lines changed

6 files changed

+27
-14
lines changed

docs/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
micrositeName := "Xreact"
2-
micrositeDescription := "Reactive x React = Xreact"
1+
micrositeName := "xReact"
2+
micrositeDescription := "Reactive x React = xReact"
33
micrositeAuthor := "Jichao Ouyang"
44
micrositeHomepage := "https://xreact.oyanglul.us/"
55
micrositeOrganizationHomepage := "https://oyanglul.us"

docs/src/main/tut/Examples.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ section: en
55
position: 4
66
---
77

8-
- [Counter](https://github.com/reactive-react/react-most/tree/master/examples/counter)
9-
- [BMI Calculator](http://jsbin.com/bojaqiv/edit?js,output)
8+
# Counter
9+
<iframe src="https://www.webpackbin.com/bins/-KsSYQVTkFjd_MQon3b9" frameborder="0" width="100%" height="500"></iframe>
10+
11+
## BMI Calculator
12+
13+
<iframe src="https://www.webpackbin.com/bins/-Ksaj0iHMWD2xC24bAqR" frameborder="0" width="100%" height="500"></iframe>
14+
1015
- [Type N Search](https://github.com/reactive-react/react-most/tree/master/examples/type-n-search) [(live)](https://reactive-react.github.io/react-most/examples/type-n-search/public/)
16+
1117
- [TodoMVC](https://github.com/reactive-react/react-most/tree/master/examples/todomvc) [(live)](https://reactive-react.github.io/react-most/examples/todomvc/public/)
12-
- [Type N Search with Transducers](https://github.com/reactive-react/react-most/tree/master/examples/transducer-type-n-search) [(live)](https://reactive-react.github.io/react-most/examples/transducer-type-n-search/public/)
13-
- [Type N Search with Time Travel](https://github.com/reactive-react/react-most/tree/master/examples/type-n-search-with-undo) [(live)](https://reactive-react.github.io/react-most/examples/type-n-search-with-undo/public/)

docs/src/main/tut/FRP-Best-Practice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: docs
3-
title: Functional Best Practice in xReact
3+
title: Functional Best Practice
44
section: en
55
---
66

docs/src/main/tut/Get-Started.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ position: 1
2020
Sorry we don't have a **book** to document how to use xreact, and I don't really need to,
2121
there's only 3 things you should notice when using xreact, I'll explain by a simple counter app.
2222

23+
<iframe src="https://www.webpackbin.com/bins/-KsSVkmGpVrLlwylSrkE" frameborder="0" width="100%" height="500"></iframe>
24+
2325
### 1. Define a simple stateless View component
2426

2527
![](https://www.evernote.com/l/ABd-YTQc2FVBjqOEkpiFZDltPloti8a2Hq8B/image.png)
@@ -78,7 +80,7 @@ a `Machine` defines
7880

7981
```js
8082
import {render} from 'react-dom'
81-
import X, {x} from 'xreact/lib/x'
83+
import {x, X} from 'xreact/lib/x'
8284
import * as rx from 'xreact/lib/xs/rx'
8385

8486
const Counter = x(plan)(CounterView)
@@ -93,3 +95,10 @@ render(
9395
`Counter` is product(x) of `plan` and `CounterView`, which means it can react to `Intent` as it's plan, and update `CounterView`
9496

9597
`<X></X>` will provide a `intent$` instance.
98+
99+
100+
## Type Safe Counter
101+
102+
If you are TypeScript user and want to enjoy a type safe counter app, it's simple to do so since Xreact is written 100% in TypeScript.
103+
104+
<iframe src="https://www.webpackbin.com/bins/-KsSYQVTkFjd_MQon3b9" frameborder="0" width="100%" height="500"></iframe>

docs/src/main/tut/React-Most-函数式最佳实践.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
layout: docs
3-
title: Xreact 函数式最佳实践
3+
title: xReact 函数式最佳实践
44
section: zh
55
---
66

docs/src/main/tut/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
---
22
layout: home
3-
title: "Reactive X React"
3+
title: "Reactive x React"
44
section: "home"
55
technologies:
66
- first: ["Functional", "Declarative and composable data flow"]
77
- second: ["Reactive", "Asynchronous flow made easy"]
88
- third: ["React", "Seamless and idiomatic integration with React"]
99
---
1010

11-
Xreact is a lightweight reactive HOC for React. Data flow in Xreact is observable and unidirectional.
11+
xReact is a lightweight reactive HOC for React. Data flow in xReact is observable and unidirectional.
1212

1313
![](https://www.evernote.com/l/ABdv2Ks5f7dNQKxyoz7Q1eB9Xm9vy3U11ZMB/image.png)
1414

@@ -19,7 +19,7 @@ npm install xreact --save
1919
yarn add xreact
2020
```
2121

22-
A [quick walk through of a counter app](Get-Started.html) will give you a brief idea of how Xreact work.
22+
A 👉 [quick walk through of a counter app](Get-Started.html) will give you a brief idea of how xReact work.
2323

2424
## Features
2525

@@ -31,7 +31,7 @@ In imperatively written code, you describe step-by-step how to process data. Wi
3131
There's also [Fantasy Land](https://github.com/fantasyland/fantasy-land) implementation in `src/fantasy.ts`, you can see [bmi calculator example](https://github.com/reactive-react/xreact/blob/master/examples/bmi-calc/app.tsx) to get the idea.
3232

3333
### Typesafe and scalable
34-
Rewritten in Typescript, and abstract Stream as Higher Kind type so easier to bring new FRP lib to integrete with xreact.
34+
xReact is 100% Typescript!, abstract Stream as Higher Kind type so easier to bring new FRP lib to integrete with xreact.
3535

3636
### Composable and Reusable `Plan`
3737
In Redux, reducers' use of `switch` statements can make them difficult to compose. Unlike reducers, the function `x` return is simply a function which can easily compose.
@@ -67,7 +67,7 @@ intent$.filter(x=>x.kind=='rest')
6767
where `fetch(url)` will return a `Promise`,
6868

6969
### Reactive libs of your choice
70-
Xreact came with 2 FRP libs of choices, rxjs and mostjs, for any new lib you only need to implement the `StaticStream` with your prefered lib as Higher Kind Type.
70+
xReact came with 2 FRP libs of choices, rxjs and mostjs, for any new lib you only need to implement the `StaticStream` with your prefered lib as Higher Kind Type.
7171

7272
more details about HKT implementation in TypeScript is [here](https://github.com/gcanti/fp-ts)
7373

0 commit comments

Comments
 (0)