mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 12:41:37 +00:00
chore: housekeeping
This commit is contained in:
parent
3134136e70
commit
c842926abe
6 changed files with 44 additions and 36 deletions
|
|
@ -497,7 +497,7 @@ end)
|
|||
|
||||
test("recursive effects should run and cleanup in order", function()
|
||||
local a, setA = signal(0)
|
||||
local order = {}
|
||||
local order: { string } = {}
|
||||
|
||||
effect(function()
|
||||
local value = a()
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ end)
|
|||
|
||||
test("should handle recursive additions and removals", function()
|
||||
local items, setItems = signal({ 1 })
|
||||
local edits = {}
|
||||
local edits: { string } = {}
|
||||
|
||||
observe(items, function(item)
|
||||
if item < 5 then
|
||||
|
|
@ -114,7 +114,7 @@ end)
|
|||
|
||||
test("should handle self removal", function()
|
||||
local items, setItems = signal({ 1, 2, 3, 4 })
|
||||
local edits = {}
|
||||
local edits: { string } = {}
|
||||
|
||||
observe(items, function(item, index)
|
||||
setItems(function(state: { number })
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ test("should run in untracked", function()
|
|||
end)
|
||||
|
||||
test("should ensure correct execution order", function()
|
||||
local order = {}
|
||||
local order: { number } = {}
|
||||
local n1, setN1 = signal(0)
|
||||
local n2, setN2 = signal(0)
|
||||
local sum = computed(function()
|
||||
|
|
@ -72,7 +72,7 @@ test("should ensure correct execution order", function()
|
|||
end)
|
||||
|
||||
test("should skip redundant updates", function()
|
||||
local order = {}
|
||||
local order: { "even" | "odd" } = {}
|
||||
local a, setA = signal(0)
|
||||
|
||||
subscribe(function(): "even" | "odd"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue