0.0.13 • Published 10 years ago

cycle-markdown-driver v0.0.13

Weekly downloads
14
License
MIT
Repository
github
Last release
10 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

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.10

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago