mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
refactor: rename unwrap to peek
This commit is contained in:
parent
1e7e20902a
commit
047be71eaa
6 changed files with 16 additions and 16 deletions
|
|
@ -1,12 +1,12 @@
|
|||
local atom = require(script.Parent.Parent.atom)
|
||||
local peek = require(script.Parent.Parent.peek)
|
||||
local store = require(script.Parent.Parent.store)
|
||||
local unwrap = require(script.Parent.Parent.unwrap)
|
||||
|
||||
return function()
|
||||
it("calls an atom without capturing it", function()
|
||||
local a, b, c = atom(1), atom(1), atom(1)
|
||||
local captured, result = store.capture(function()
|
||||
return a() + unwrap(b) + c()
|
||||
return a() + peek(b) + c()
|
||||
end)
|
||||
expect(captured[a]).to.be.ok()
|
||||
expect(captured[b]).to.never.be.ok()
|
||||
|
|
@ -15,8 +15,8 @@ return function()
|
|||
end)
|
||||
|
||||
it("passes through arguments", function()
|
||||
expect(unwrap(1)).to.equal(1)
|
||||
expect(unwrap(function()
|
||||
expect(peek(1)).to.equal(1)
|
||||
expect(peek(function()
|
||||
return 1
|
||||
end)).to.equal(1)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue