Code Monkey home page Code Monkey logo

bunshi's Introduction

Jotai (light mode)

Bunshi (formerly jotai-molecules)

A tiny, fast, dependency-free 1.18kb library for creating states stores and other dependencies that lets you lift state up or push state down. Works out of the box with React, Vue and vanilla javascript and Typescript.

Definition: Bunshi (分子 / ぶんし) - Japanese for molecule, member or element.

Works well with state solutions like:

Comes out of the box with support for:

  • React
  • Vue
  • Vanilla Javascript & Typescript

See the docs for more details on why we created this library and how to use it.

Inspired by jotai and guice.

Installation

This module is published on NPM as bunshi

npm i bunshi

Documentation

Check out the docs on bunshi.org.

Migrating from jotai-molecules

Coming from an older version of jotai-molecules? The core API and functionality is the same, but bunshi no longer assumes react as the default use case.

import { atom } from "jotai"
- import { molecule, useMolecule } from "jotai-molecules"
+ import { molecule, useMolecule } from "bunshi/react"

const countMolecule = molecule(()=>atom(0));

const Counter = ()=>{

    const [count,setCount] = useAtom(useMolecule(countMolecule));

    return <div>
        Count is {count}
        <button onClick={()=>setCount(c=>c+1)}>Increment</button>
    </div>
}

bunshi's People

Contributors

loganvolkers avatar johanventer avatar 00salmon avatar dereksiemens avatar locrian24 avatar davidjfelix avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.