partial re-implementation of Recoil
no history, no selectors, just useRecoilState
/useRecoilValue
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)
...
}