mirror of
https://github.com/littensy/charm.git
synced 2026-10-22 04:14:08 +00:00
feat: add sync typescript types
This commit is contained in:
parent
a30293ee3b
commit
dda00f7a4e
3 changed files with 55 additions and 13 deletions
|
|
@ -7,13 +7,13 @@ type ClientSyncOptions = {
|
|||
atoms: { [string]: Atom<any> },
|
||||
}
|
||||
|
||||
type ClientSync = {
|
||||
sync: (self: ClientSync, payload: types.SyncPayload) -> (),
|
||||
type ClientSyncer = {
|
||||
sync: (self: ClientSyncer, payload: types.SyncPayload) -> (),
|
||||
}
|
||||
|
||||
local function client(options: ClientSyncOptions): ClientSync
|
||||
local function client(options: ClientSyncOptions): ClientSyncer
|
||||
local atoms = options.atoms
|
||||
local self = {} :: ClientSync
|
||||
local self = {} :: ClientSyncer
|
||||
|
||||
function self:sync(payload)
|
||||
for key, state in payload.data do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue