Simplify example in readme.
This commit is contained in:
Родитель
f2b9b42308
Коммит
27c230fd1f
|
@ -9,16 +9,12 @@ This is a [reflex][] application view driver that uses [virtual-dom][] library f
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import * as App from "./app"
|
import {init, update, view} from "./app"
|
||||||
import {start} from "reflex"
|
import {start} from "reflex"
|
||||||
import {Renderer} from "reflex-virtual-dom-driver"
|
import {Renderer} from "reflex-virtual-dom-driver"
|
||||||
|
|
||||||
const renderer = new Renderer({target: document.body})
|
const renderer = new Renderer({target: document.body})
|
||||||
const app = start({
|
const app = start({init, update, view}, ({view}) => {
|
||||||
initial: App.initialize(),
|
|
||||||
update: App.update,
|
|
||||||
view: App.view
|
|
||||||
}, ({view}) => {
|
|
||||||
renderer.render(view)
|
renderer.render(view)
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
Загрузка…
Ссылка в новой задаче