Socket
Book a DemoInstallSign in
Socket

@motorcycle/html

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@motorcycle/html

Motorcycle.js HTML Driver

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
2
Created
Source

Motorcycle HTML Driver Build Status Motorcycle.js

This is the standard HTML driver for Motorcycle built using snabbdom-to-html.

Installing

$ npm install @motorcycle/html

Want to Contribute?

If you found an issue or want to contribute code, please read the contributing guidelines.

Example Usage

import {run} from '@motorcycle/core'
import {h2} from '@motorcycle/dom'
import htmlDriver from '@motorcycle/html'

function app(sources) {
  ...
  return {
    HTML: most.just(h2('Hello, world!'))
  }
}

const {sources} = run(app, {
  HTML: htmlDriver,
})

sources.HTML.select(':root').observable.observe(html => {...})

API

htmlDriver(source$)

htmlDriver is a function which takes a stream of Snabbdom virtual nodes and returns a stream of HTML strings.

Arguments

source$ :: most.Stream - A stream of Snabbdom virtual nodes.

Returns

(Object): An object with a single method select().

select() :: Function - A function which return as an object containing observable and events().

observable :: most.Stream - A stream of HTML strings.

events() :: Function - A function which returns an empty stream for compatibility with the DOM driver API.

Keywords

Motorcycle.js

FAQs

Package last updated on 30 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts