charm/src/init.luau
richard 6a9c580bd7
feat: add effect cleanups, add docs (#2)
* docs: update readme

* feat: add cleanup function to effects

* refactor: move peek function to store module

* test: add nested atom check

* docs: add doc comments

* fix: `effect()` type

* refactor: remove divider comment
2024-06-02 01:25:00 -07:00

32 lines
848 B
Text

_G[script.modules.Promise] = _G[script]
local atom = require(script.atom)
local computed = require(script.computed)
local effect = require(script.effect)
local mapped = require(script.mapped)
local observe = require(script.observe)
local useAtom = require(script.react.useAtom)
local store = require(script.store)
local subscribe = require(script.subscribe)
local sync = require(script.sync)
local types = require(script.types)
export type Atom<State> = types.Atom<State>
export type Molecule<State> = types.Molecule<State>
export type SyncPayload = types.SyncPayload
return {
atom = atom,
computed = computed,
effect = effect,
mapped = mapped,
observe = observe,
useAtom = useAtom,
batch = store.batch,
capture = store.capture,
isAtom = store.isAtom,
notify = store.notify,
peek = store.peek,
subscribe = subscribe,
sync = sync,
}