New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

neowidget

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

neowidget

Virtual DOM based Widget for Neon.js

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

Virtual DOM based Widget for Neon.js

Requirements

NeoWidget uses JSX to define DOM Trees, so you will need jsx-transform-loader for webpack, jsxtransformify for Browserify or something based on jsx-transform to preprocess JSX.

Setup:

npm install -save neowidget

Webpack Example

webpack.config.js

{..., loader: 'jsx-transform-loader'}

Browserify Example

npm install -save jsxtransformify

browserify -t jsxtransformify file.js -o output.js

Usage Example

You need to specify the @docblock in the files where you use JSX: /** @jsx NeoWidget.h */

/** @jsx NeoWidget.h */

var Heading = Class('Heading').inherits(NeoWidget)({
  data : {
    title : 'Heading Title'
  }

  template : function() {
    return <div>
            <h2>{this.data.title}</h2>
          </div>
  }
});

Class('Button').inherits(NeoWidget)({
  prototype : {
    data : {
      title : 'Click Me!',
      count : 0
    },
    template : function() {
      return  <div>
                {new <Heading />.virtualNode}
                <button onclick={this.clickHandler.bind(this)}>{this.data.title}</button>
                <p>{'Clicks: ' + this.data.count}</p>
              </div>
    },

    clickHandler : function() {
      this.data.count++
      this.update(this.data);
    }
  }
});

var widget = new Button()
widget.render(document.body);

Keywords

FAQs

Package last updated on 28 Jul 2015

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