• Stars
    star
    218
  • Rank 181,805 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Molecule pattern for jotai, valtio, zustand, nanostores, xstate, react and vue

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>
}

More Repositories

1

json-schema-inferrer

Java library for inferring JSON schema from sample JSONs
Java
162
star
2

stencil-hooks

A React-hooks API for Stencil components
TypeScript
39
star
3

jsonata-visual-editor

Visual editor for jsonata
TypeScript
21
star
4

dom-context

A context library for web components and vanilla dom
TypeScript
13
star
5

jsonata-ui-core

Core AST and serializers for jsonata-ui
TypeScript
13
star
6

jotai-hook-form

Build complex forms with jotai, using JSON pointers.
TypeScript
11
star
7

saasquatch-docs

πŸ“– SaaSquatch public documentation
HTML
8
star
8

squatch-ios

Official Swift SDK for SaaSquatch. REST API wrapper and widgets in iOS WKWebView
Swift
7
star
9

squatch-js

🌐 The official SaaSquatch Javascript Web/Browser SDK
TypeScript
5
star
10

squatch-android

Official Android SDK for SaaSquatch. REST API wrapper and widgets in Android WebViews
Java
5
star
11

universal-hooks

The "Write Once, Run Anywhere" React Hooks API
TypeScript
4
star
12

raisins

Likes GrapesJS but more dry
HTML
4
star
13

saasquatch-cli

❯ A command line interface to the Referral SaaSquatch API
JavaScript
4
star
14

git-branch-util

Makes integrating feature branches into "staging" and "master" branches easy
Ruby
3
star
15

mobile-sdk-android-sample

Sample Android Mobile SDK App
Java
2
star
16

saasquatch-java-sdk

SaaSquatch SDK for Java
Java
2
star
17

program-tools

Collection of tools and examples to help create program templates for the SaaSquatch platform
TypeScript
2
star
18

mobile-sdk-ios-sample

Sample ios SDK App
Swift
2
star
19

picklesdoc

Generate XLSX and JSON documents from your Gherkin feature files. Javascript port of picklesdoc.com
TypeScript
1
star
20

schema

πŸ€– Machine readable schemas global to the SaaSquatch platform
TypeScript
1
star
21

micro-job-scheduler

Promise-based in-memory micro job scheduler.
TypeScript
1
star
22

mobile-sdk-objectivec-cocoapod

πŸ“± The official Referral SaaSquatch iOS Mobile SDK for Objective-C
Objective-C
1
star
23

time-credit-theme

A generic time credit theme for Referral Saasquatch
HTML
1
star
24

rhino-jsonata

JSONata for Java backed by jsonata-js and Rhino
1
star
25

stencil-docx-docs

Stencil Word .docx component documentation generator
TypeScript
1
star
26

dollar-credit-theme

A generic dollar credit theme for Referral Saasquatch
HTML
1
star
27

percent-credit-theme

A generic percent credit theme for Referral Saasquatch
HTML
1
star
28

apache-client5-reactive

Thin wrapper around Apache HttpAsyncClient 5.x to expose Reactive Streams interfaces.
Java
1
star
29

stencil-html-parser

HTML to Stencil Parser. Stencil fork of https://github.com/remarkablemark/html-react-parser
TypeScript
1
star