0.2.1 • Published 7 years ago

flimflam-render v0.2.1

Weekly downloads
100
License
MIT
Repository
github
Last release
7 years ago

flimflam-render

Render a Flimflam UI component onto the page (and keep rendering/patching it on every stream update).

This module is included in the core flimflam package, and you can require it require('flimflam/render').

render(view, state, container)

This function is all you need to render your top-level UI component to the page. It only needs to be called once for a whole one-page app using the top-most view and state.

  • view: the top-level view function that takes the state as a parameter and returns a vnode tree
  • state: an object containing values, flyd streams, and nested objects for use in the view
  • container: a regular DOM Node that you want to replace with the markup generated by your view function

Usage

const render = require('flimflam/render')

// import your app's parent component and view function...
const component = require('./my-component')

const view = component.view
const state = component.init()
const container = document.body
render(view, state, container)

development

Tests use tape and tape-run, and can be executed with: npm run test

The main index.js file is plain ES5, while the test file uses browserify with es2040.

0.2.1

7 years ago

0.2.0

7 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago