diff --git a/README.md b/README.md index df44ff1..0096abd 100644 --- a/README.md +++ b/README.md @@ -326,7 +326,20 @@ within namespaced `models`, and usage should preferably be kept to a minimum. Changing views all over the place tends to lead to messiness. ## Views -[docs wip] +Views are pure functions that return a DOM tree for the router to render. They’re passed the current state, and any time the state changes they’re run again with the new state. + +Views are also passed the `send` function, which they can use to dispatch actions that can update the state. For example, the DOM tree can have an `onclick` handler that dispatches an `add` action. + +```javascript +const view = (params, state, send) => { + return choo.view` +