atom.io 0.34.2 → 0.35.0

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.
Files changed (51) hide show
  1. package/dist/internal/index.d.ts +32 -41
  2. package/dist/internal/index.d.ts.map +1 -1
  3. package/dist/internal/index.js +106 -128
  4. package/dist/internal/index.js.map +1 -1
  5. package/dist/json/index.d.ts +7 -7
  6. package/dist/json/index.js +2 -2
  7. package/dist/json/index.js.map +1 -1
  8. package/dist/main/index.d.ts +779 -886
  9. package/dist/main/index.d.ts.map +1 -1
  10. package/dist/main/index.js +46 -14
  11. package/dist/main/index.js.map +1 -1
  12. package/dist/react-devtools/index.js +10 -10
  13. package/dist/react-devtools/index.js.map +1 -1
  14. package/dist/realtime/index.d.ts.map +1 -1
  15. package/dist/realtime/index.js +3 -5
  16. package/dist/realtime/index.js.map +1 -1
  17. package/dist/realtime-client/index.js +10 -10
  18. package/dist/realtime-client/index.js.map +1 -1
  19. package/dist/realtime-server/index.d.ts.map +1 -1
  20. package/dist/realtime-server/index.js +8 -10
  21. package/dist/realtime-server/index.js.map +1 -1
  22. package/package.json +4 -4
  23. package/src/internal/atom/create-regular-atom.ts +1 -0
  24. package/src/internal/atom/index.ts +0 -1
  25. package/src/internal/families/index.ts +0 -1
  26. package/src/internal/index.ts +111 -89
  27. package/src/internal/join/join-internal.ts +3 -4
  28. package/src/internal/mutable/create-mutable-atom-family.ts +0 -1
  29. package/src/internal/mutable/create-mutable-atom.ts +1 -1
  30. package/src/internal/selector/register-selector.ts +2 -2
  31. package/src/json/entries.ts +7 -7
  32. package/src/main/atom.ts +67 -114
  33. package/src/main/dispose-state.ts +0 -2
  34. package/src/main/find-state.ts +3 -9
  35. package/src/main/get-state.ts +0 -2
  36. package/src/main/index.ts +1 -176
  37. package/src/main/join.ts +0 -7
  38. package/src/main/reset-state.ts +0 -2
  39. package/src/main/selector.ts +5 -72
  40. package/src/main/set-state.ts +1 -4
  41. package/src/main/silo.ts +14 -5
  42. package/src/main/subscribe.ts +0 -7
  43. package/src/main/timeline.ts +1 -18
  44. package/src/main/tokens.ts +247 -0
  45. package/src/main/transaction.ts +17 -55
  46. package/src/main/validators.ts +1 -1
  47. package/src/react-devtools/store.ts +61 -45
  48. package/src/realtime/shared-room-store.ts +3 -5
  49. package/src/realtime-server/realtime-server-stores/server-user-store.ts +3 -5
  50. package/src/internal/atom/create-standalone-atom.ts +0 -39
  51. package/src/internal/families/create-atom-family.ts +0 -38
@@ -1,39 +0,0 @@
1
- import type {
2
- AtomToken,
3
- MutableAtomOptions,
4
- MutableAtomToken,
5
- RegularAtomOptions,
6
- RegularAtomToken,
7
- } from "atom.io"
8
- import type { Json } from "atom.io/json"
9
-
10
- import type { Transceiver } from "../mutable"
11
- import { createMutableAtom } from "../mutable"
12
- import type { Store } from "../store"
13
- import { createRegularAtom } from "./create-regular-atom"
14
-
15
- export function createStandaloneAtom<T>(
16
- store: Store,
17
- options: RegularAtomOptions<T>,
18
- ): RegularAtomToken<T>
19
-
20
- export function createStandaloneAtom<
21
- T extends Transceiver<any>,
22
- J extends Json.Serializable,
23
- >(store: Store, options: MutableAtomOptions<T, J>): MutableAtomToken<T, J>
24
-
25
- export function createStandaloneAtom<T>(
26
- store: Store,
27
- options: MutableAtomOptions<any, any> | RegularAtomOptions<T>,
28
- ): AtomToken<T> {
29
- const isMutable = `mutable` in options
30
-
31
- if (isMutable) {
32
- const state = createMutableAtom(store, options, undefined)
33
- store.on.atomCreation.next(state)
34
- return state
35
- }
36
- const state = createRegularAtom(store, options, undefined)
37
- store.on.atomCreation.next(state)
38
- return state
39
- }
@@ -1,38 +0,0 @@
1
- import type {
2
- AtomFamilyToken,
3
- MutableAtomFamilyOptions,
4
- MutableAtomFamilyToken,
5
- RegularAtomFamilyOptions,
6
- RegularAtomFamilyToken,
7
- } from "atom.io"
8
- import type { Canonical, Json } from "atom.io/json"
9
-
10
- import { createMutableAtomFamily, type Transceiver } from "../mutable"
11
- import type { Store } from "../store"
12
- import { createRegularAtomFamily } from "./create-regular-atom-family"
13
-
14
- export function createAtomFamily<
15
- T extends Transceiver<any>,
16
- J extends Json.Serializable,
17
- K extends Canonical,
18
- >(
19
- store: Store,
20
- options: MutableAtomFamilyOptions<T, J, K>,
21
- ): MutableAtomFamilyToken<T, J, K>
22
- export function createAtomFamily<T, K extends Canonical>(
23
- store: Store,
24
- options: RegularAtomFamilyOptions<T, K>,
25
- ): RegularAtomFamilyToken<T, K>
26
- export function createAtomFamily<T, K extends Canonical>(
27
- store: Store,
28
- options:
29
- | MutableAtomFamilyOptions<any, any, any>
30
- | RegularAtomFamilyOptions<T, K>,
31
- ): AtomFamilyToken<any, any> {
32
- const isMutable = `mutable` in options
33
-
34
- if (isMutable) {
35
- return createMutableAtomFamily(store, options)
36
- }
37
- return createRegularAtomFamily<T, K>(store, options)
38
- }