JSPM

  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q55220F
  • License ISC

Simple and declarative data binding for the DOM

Package Exports

  • synergy

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (synergy) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

synergy

npm Build Status Coverage Status gzip size

Simple and declarative data binding for the DOM.

Table of Contents

Features

  • Simple and declarative way to bind data, events, and markup
  • Small footprint (~3.6k)
  • No special tooling required (e.g., compilers, plugins)
  • Minimal learning curve (almost entirely standard HTML, JS, and CSS!)

Browser Support

Works in any modern browser that supports JavaScript Proxy.

Install

Using npm:

$ npm i synergy

Using unpkg CDN:

<script type="module">
  import synergy from 'https://unpkg.com/synergy';
</script>

Render

The render() method combines an HTML template with a JavaScript object and then mounts the rendered HTML into an existing DOM node.

Syntax

let view = synergy.render(targetNode, viewmodel, template);

Parameters

  • targetNode An existing HTML element node where the rendered HTML should be mounted.

  • viewmodel A plain JavaScript object that contains the data for your view.

  • template Either an HTML string or a