Skip to content

Instantly share code, notes, and snippets.

@dlai0001
dlai0001 / useState.js
Created April 2, 2022 11:42
A crude use state implementation
// For Reference
const states = []
let calls = -1
function useState(value) {
const call = ++calls
if (states[call]) {
return states[call]