Coder Social home page Coder Social logo

flimflam-render's Introduction

flimflam-render

Given a root flimflam component (an object with .streams, .updates, .data, and .children), a snabbdom view function, and a DOM Node container, render the component to the page. Continuously patch/update the page using the streams and updates from the component.

Use the very top-level, parent component for your page. You only need to call this function once per page.

In your flimflam components, you can leave out any of .streams, .updates, .data, and .children. They are all optional.

import render from 'flimflam-render'

// import your app's parent component and view function...

render(component, viewFunc, domContainer, options)

// state: a flimflam state object (your app's root component for the page)
// viewFunc: snabbdom view function that takes a state object and returns a snabbdom VTree
// domContainer: an HTML Node from the actual web-page to render into (this node will be replaced with your view function's root node)
// options: an optional object of..
//     patch: your custom snabbdom patch function
//     debug: (Boolean) whether to log every new set of state data for debugging

flimflam-render's People

Contributors

jayrbolton avatar

Watchers

James Cloos avatar  avatar

Forkers

mangelmaxime

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.