@defacto/cell-js

Simple solution for binding Javascript to specific templates or side server components

Stats

StarsIssuesVersionUpdatedCreatedSize
@defacto/cell-js
601.1.22 years ago4 years agoMinified + gzip package size for @defacto/cell-js in KB

Readme

cell-js

Simple and lightweight solution for binding Javascript to specific templates or side server components.
We use this alongside ex_cell, an Elixir/Phoenix module for coupling Javascript, CSS, Javascript and Views.

Installation

npm install @defacto/cell-js

or

yarn add @defacto/cell-js

Usage

import { Cell, Builder } from "cells-js";

class AvatarCell extends Cell {
  initialize() {
    this.element.addEventListener("click", this.onToggleOpenClass);
  }

  onToggleOpenClass = e => this.element.classList.toggle("open");
}

Builder.register(AvatarCell, "AvatarCell");

export default AvatarCell;

For a more complete implementation see ex_cell.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.