0.0.13 • Published 9 years ago

cycle-markdown-driver v0.0.13

Weekly downloads
14
License
MIT
Repository
github
Last release
9 years ago

Cycle Markdown Driver

A Cycle.js Driver for parsing Markdown from text. This package is small, and untested.

npm install cycle-markdown-driver

Usage

import Cycle, {Rx} from '@cycle/core';
import {makeDOMDriver} from '@cycle/dom';
import {makeMarkdownDriver} from 'cycle-markdown-driver';

function main(responses) {
  const keydownOnTextarea$ = DOM.select('#raw').events('keydown')
    .debounce(500)
    .map(e => e.target.value)
    .filter(query => query.length > 0)

  const vtree$ = responses.MARKDOWN
    .mergeAll()
    .map(res => {
      h('div.container', [
        h('p', res.content)
      ])
    });

  return {
    DOM: vtree$,
    MARKDOWN: keydownOnTextarea$
  };
}

Cycle.run(main, {
  DOM: makeDOMDriver('.js-container'),
  MARKDOWN: makeMarkdownDriver()
})
0.0.13

9 years ago

0.0.12

9 years ago

0.0.11

9 years ago

0.0.10

9 years ago

0.0.9

9 years ago

0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago