mirror of
https://github.com/littensy/charm.git
synced 2026-10-20 17:51:37 +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,8 +1,8 @@
|
|||
local peek = require(script.Parent.peek)
|
||||
local store = require(script.Parent.store)
|
||||
local types = require(script.Parent.types)
|
||||
type Atom<T> = types.Atom<T>
|
||||
type AtomOptions<T> = types.AtomOptions<T>
|
||||
local unwrap = require(script.Parent.unwrap)
|
||||
|
||||
local function atom<T>(state: T, options: AtomOptions<T>?): Atom<T>
|
||||
local equals = options and options.equals
|
||||
|
|
@ -17,7 +17,7 @@ local function atom<T>(state: T, options: AtomOptions<T>?): Atom<T>
|
|||
end
|
||||
|
||||
-- Atoms called in a function should not be a part of the dependency tree
|
||||
local nextState = unwrap(..., state)
|
||||
local nextState = peek(..., state)
|
||||
|
||||
if state ~= nextState and not (equals and equals(state, nextState)) then
|
||||
state = nextState
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue