refactor: remove unnecessary features, update docs

This commit is contained in:
littensy 2025-11-02 18:55:41 -08:00
parent 7a88c784fa
commit 37f79ecc3f
20 changed files with 774 additions and 955 deletions

View file

@ -1,12 +1,12 @@
local Charm = require("./Charm")
local Vide = require("./Vide")
--- Returns a reactive source that updates when the given getter function's
--- value changes.
--- Returns a reactive source that subscribes to the current value of the given
--- signal or getter function.
---
--- @param getter The atom or selector to subscribe to.
--- @param getter The getter function to subscribe to.
--- @return The reactive source.
local function useAtom<State>(getter: () -> State): () -> State
local function useSignalState<State>(getter: () -> State): () -> State
local state = Vide.source(getter())
Vide.cleanup(Charm.effect(function()
@ -18,5 +18,6 @@ local function useAtom<State>(getter: () -> State): () -> State
end
return {
useAtom = useAtom,
useSignalState = useSignalState,
useAtom = useSignalState,
}