refactor: rename unwrap to peek

This commit is contained in:
Richard 2024-04-23 20:35:42 -07:00
parent 1e7e20902a
commit 047be71eaa
6 changed files with 16 additions and 16 deletions

View file

@ -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)