Skip to content
default
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 

minicoil

partial re-implementation of Recoil

no history, no selectors, just useRecoilState/useRecoilValue

usage

state.tsx

import {atom} from 'minicoil'
export const SomeState = atom({key: 'CursorPosition', default: {x:0,y:0}})

components.tsx

import {useRecoilState} from 'minicoil'
import {SomeState} from './state'

export function FirstComponent() {
  let [position, setPosition] = useRecoilState(SomeState) // same as `useState` but with atom ref instead of default value
  ...
}

export function SecondComponent() {
  let [position, setPosition] = useRecoilState(SomeState)
  ...
}

About

minicoil

Resources

License

Releases

No releases published

Packages

No packages published