⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

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

License

Notifications You must be signed in to change notification settings

DefactoSoftware/cell-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •