mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 19:54:09 +00:00
build: remove project json files
Including Rojo project files in packages interferes with certain Wally packages that depend on roblox-ts packages
This commit is contained in:
parent
e7fe400fa8
commit
aff5f768bf
42 changed files with 68 additions and 88 deletions
|
|
@ -1,25 +0,0 @@
|
|||
local Charm = require(script.Parent.Charm)
|
||||
local Vide = if script.Parent:FindFirstChild("vide")
|
||||
then require(script.Parent.vide.src) :: never
|
||||
else require(script.Parent.Vide)
|
||||
|
||||
--[=[
|
||||
Subscribes to the state of an atom and returns a Vide source.
|
||||
|
||||
@param callback The atom or selector to subscribe to.
|
||||
@return The reactive source.
|
||||
]=]
|
||||
local function useAtom<State>(callback: () -> State): () -> State
|
||||
local state = Vide.source(callback())
|
||||
local unsubscribe = Charm.subscribe(callback, function(value)
|
||||
task.spawn(state :: (State) -> State, value)
|
||||
end)
|
||||
|
||||
Vide.cleanup(unsubscribe)
|
||||
|
||||
return state
|
||||
end
|
||||
|
||||
return {
|
||||
useAtom = useAtom,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue