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

cyclejs-ace-editor

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cyclejs-ace-editor

Cycle.js wrapper for the Ace Editor

  • 0.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

cyclejs-ace-editor

Cycle.js intergration with Ace Editor using brace.

See live example.

Installation

npm install cyclejs-ace-editor --save

API

{editor$, value$} = AceEditor({DOM, params$, initialValue$})

Sources:

  • params$ - observable with a key-value configuration
  • initialValue$ - observable with a string as initial editor code
  • DOM - DOM driver

Sinks:

  • editor$ - instance of Ace Editor, use when there is no built-in wrapper for the feature you want
  • value$ - observable of editor content

Supported keys for the params:

  • theme
  • mode
  • readOnly

Example

import Cycle from '@cycle/core'
import {div, h3, pre, makeDOMDriver} from '@cycle/dom'
import {Observable} from 'rx'
import AceEditor from '../../src'

function main({DOM}) {
  const editorProps$ = Observable.of()
  const initialValue$ = Observable.just('Initial code')

  const editor = AceEditor({DOM, params$: editorProps$, initialValue$})

  return {
    DOM: Observable.combineLatest(editor.DOM, editor.value$.debounce(100),
      (editorVTree, code) => {
        return div([
          editorVTree,
          h3('Debounced value'),
          pre(code)
        ])
      })
  }
}

Cycle.run(main, {
  DOM: makeDOMDriver('#example')
})

FAQs

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