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.
- package/dist/index.d.ts +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/react-devtools/dist/index.js +12 -9
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +9 -6
- package/react-devtools/dist/index.mjs.map +1 -1
- package/src/react-devtools/TokenList.tsx +13 -5
- package/src/transaction.ts +2 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
39
|
-
{key}
|
|
40
|
-
|
|
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>
|
package/src/transaction.ts
CHANGED
|
@@ -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<ƒ>
|