Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

choodown

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

choodown

A simple markdown component for choo-js

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Choodown

A simple markdown/textarea component with ability to preview your changes. Made for choo.

How to use:

npm install choodown -S

Add the following to your app model:

app.model({
  namespace: 'choodown',
  state: {
    text: '',
    mode: 'EDIT'
  },
  reducers: {
    updateText: (data, state) => ({text: data}),
    toggleMode: (mode, state) => ({mode: state.mode === 'PREVIEW' ? 'EDIT' : 'PREVIEW'})
  }
});

Add to your view like this:

const choodown = Choodown({
  text: state.choodown.text,
  mode: state.choodown.mode,
  onChange: (e) => send('choodown:updateText', e.target.value),
  onToggle: () => send('choodown:toggleMode')
});

return html`
  <main>
    <h1>Choodown demo</h1>
    ${choodown}
  </main>`

Example

You can see a full working example by cloning this repo:

  1. clone this repo
  2. run npm install
  3. run npm start
  4. go to localhost:8080

Keywords

FAQs

Package last updated on 18 Jul 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc