mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 11:44:08 +00:00
feat: prepare for alpha release
This commit is contained in:
parent
5a05f01223
commit
f5709c3112
10 changed files with 251 additions and 54 deletions
|
|
@ -15,7 +15,6 @@ local function useAtom<T>(getter: () -> T, dependencies: { any }?): T
|
|||
local state, setState = React.useState(getter)
|
||||
|
||||
React.useLayoutEffect(function()
|
||||
setState(getter())
|
||||
return Charm.effect(function()
|
||||
setState(getter())
|
||||
end)
|
||||
|
|
@ -38,8 +37,7 @@ local function useAtomBinding<T>(getter: () -> T, dependencies: { any }?)
|
|||
local initialState = React.useMemo(getter, {})
|
||||
local binding, setBinding = React.useBinding(initialState)
|
||||
|
||||
React.useEffect(function()
|
||||
setBinding(getter())
|
||||
React.useLayoutEffect(function()
|
||||
return Charm.effect(function()
|
||||
setBinding(getter())
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue