jspolancor / frameworksito

A mini JS frontend framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frameworksito

A very very very small reactive front end framework made in JS

Features

  • Private state for each component
  • commit() function to update the component's state
  • getState() function to get the components state data

Usage

To instantiate a frameworksito

new frameworksito(dataObject, htmlElement);
const InputComponent = new frameworksito({text: ''}, document.querySelector('#InputComponent'));

Use the ref attribute to bind a text element to the state

<h1 ref="counter"></h1>
const ButtonComponent = new frameworksito({counter: 0}, document.querySelector('#ButtonComponent'));

Update component state using the commit function

ButtonComponent.commit('counter', 4);

Get the component's state using the getState function

ButtonComponent.getState();

About

A mini JS frontend framework


Languages

Language:HTML 64.3%Language:JavaScript 35.7%