atom.io 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ import type {
7
7
  SelectorToken,
8
8
  __INTERNAL__,
9
9
  } from "atom.io"
10
+ import { getState } from "atom.io"
10
11
  import type { StoreHooks } from "atom.io/react"
11
12
 
12
13
  import { recordToEntries } from "~/packages/anvl/src/object"
@@ -30,14 +31,21 @@ export const TokenList: FC<{
30
31
  <Fragment key={key}>
31
32
  {key.startsWith(`👁‍🗨_`) ? null : (
32
33
  <div className="node">
33
- {key}:
34
34
  {`type` in token ? (
35
- <StoreEditor storeHooks={storeHooks} token={token} />
35
+ <>
36
+ <label onClick={() => console.log(token, getState(token))}>
37
+ {key}
38
+ </label>
39
+ <StoreEditor storeHooks={storeHooks} token={token} />
40
+ </>
36
41
  ) : (
37
42
  recordToEntries(token.familyMembers).map(([key, token]) => (
38
- <div key={key} className="node">
39
- {key}:<StoreEditor storeHooks={storeHooks} token={token} />
40
- </div>
43
+ <>
44
+ <label>{key}</label>
45
+ <div key={key} className="node">
46
+ {key}:<StoreEditor storeHooks={storeHooks} token={token} />
47
+ </div>
48
+ </>
41
49
  ))
42
50
  )}
43
51
  </div>
@@ -33,6 +33,8 @@ export type Transaction<ƒ extends ƒn> = {
33
33
  run: (...parameters: Parameters<ƒ>) => ReturnType<ƒ>
34
34
  subject: Rx.Subject<TransactionUpdate<ƒ>>
35
35
  }
36
+ export type TransactionIO<Token extends TransactionToken<any>> =
37
+ Token extends TransactionToken<infer ƒ> ? ƒ : never
36
38
 
37
39
  export function transaction<ƒ extends ƒn>(
38
40
  options: TransactionOptions<ƒ>