Skip to content

Commit

Permalink
Adding Spring.story, wally.toml, Fixed Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
creepersaur committed Oct 8, 2024
1 parent 1e2c8c1 commit db11ff8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/shared/Quark/Reactive/Signal.luau
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
local module = {}
local module = {
Created = {}
}

type State<T> = {
value: T,
Expand Down Expand Up @@ -45,6 +47,8 @@ function module.new<T>(state: | { State<T> }, func: (value: any) -> ()): Signal
end
end

table.insert(module.Created, self)

return self
end

Expand Down
8 changes: 6 additions & 2 deletions src/shared/Quark/Reactive/State.luau
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
local Signal = require(script.Parent.Signal)
local module = {}
local module = {
Created = {}
}

export type State<T> = {
value: T,
Expand Down Expand Up @@ -42,7 +44,9 @@ function module.new<T>(default: T, strict: boolean?): State<T>
end

function self.connect(func): Signal.Signal
return Signal.new(self, func)
local connection = Signal.new(self, func)
table.insert(module.Created, connection)
return connection
end

return self
Expand Down
7 changes: 6 additions & 1 deletion src/shared/Quark/Reactive/init.luau
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
local State = require(script.State)
local Signal = require(script.Signal)
local Reactive = {}
local Reactive = {
Created = {}
}

State.Created = Reactive.Created
Signal.Created = Reactive.Created

export type State<T> = State.State<T>
Reactive.State = State.new
Expand Down

0 comments on commit db11ff8

Please sign in to comment.