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

ampersand-virtual-dom-mixin

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-virtual-dom-mixin

## *NOTE:* this module is intentially at 0.x.x since the public api is still under discussion. minor/patch releases may be breaking changes until 1.0.0 hits. _Community feedback wanted_

  • 0.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

ampersand-virtual-dom-mixin

NOTE: this module is intentially at 0.x.x since the public api is still under discussion. minor/patch releases may be breaking changes until 1.0.0 hits. Community feedback wanted

var vdomMixin = require('ampersand-virtual-dom-mixin');
var View = require('ampersand-view');

var MyView = View.extend(vdomMixin, {
    template: require('my-template.jade'), //if useing jadeify, or whatever

    initialize: function () {
        //you just need to trigger render when things change,
        //the simplest might be:

        this.on('change', this.render);
    }
});

Notes on usage of this version:

  • There's a demo.js in the repo npm run demo, http://localhost:9967
  • Rendering subviews manually in an overridden render method is an anti-pattern with this mixin. You'll want to use the subviews hash to do so declaratively.
  • This enables you in a template to render/remove the target el for a subview, and that el will be created/torn down appropriately.
  • This mixin rewrites _parseSubview. The prepareView function will no longer receive an el, so rendered subviews will be appended to, rather than replace, the selected el.
  • component rendering has been removed, for now.

FAQs

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