1.1.2 • Published 5 years ago

@defacto/cell-js v1.1.2

Weekly downloads
2,879
License
MIT
Repository
github
Last release
5 years ago

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.

1.1.2

5 years ago

1.1.1

5 years ago

1.0.0

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

8 years ago