This package has been deprecated

Author message:

Moved into package 'flimflam'

flimflam-render

0.2.1 • Public • Published

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.

Package Sidebar

Install

npm i flimflam-render

Weekly Downloads

11

Version

0.2.1

License

MIT

Last publish

Collaborators

  • jayrbolton
  • the_swerve