atom.io 0.6.8 → 0.7.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.
- package/README.md +21 -2
- package/dist/index.d.mts +42 -461
- package/dist/index.d.ts +42 -461
- package/dist/index.js +128 -1792
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -1742
- package/dist/index.mjs.map +1 -1
- package/internal/dist/index.d.mts +342 -0
- package/internal/dist/index.d.ts +342 -0
- package/internal/dist/index.js +1873 -0
- package/internal/dist/index.js.map +1 -0
- package/internal/dist/index.mjs +1798 -0
- package/internal/dist/index.mjs.map +1 -0
- package/internal/package.json +15 -0
- package/internal/src/atom/create-atom.ts +75 -0
- package/internal/src/atom/delete-atom.ts +10 -0
- package/internal/src/atom/index.ts +3 -0
- package/{src/internal → internal/src/atom}/is-default.ts +4 -2
- package/internal/src/caching.ts +21 -0
- package/internal/src/families/create-atom-family.ts +59 -0
- package/internal/src/families/create-readonly-selector-family.ts +45 -0
- package/internal/src/families/create-selector-family.ts +67 -0
- package/internal/src/families/index.ts +3 -0
- package/internal/src/get-state-internal.ts +23 -0
- package/internal/src/index.ts +13 -0
- package/internal/src/mutable/create-mutable-atom-family.ts +25 -0
- package/internal/src/mutable/create-mutable-atom.ts +49 -0
- package/internal/src/mutable/get-json-token.ts +22 -0
- package/internal/src/mutable/get-update-token.ts +20 -0
- package/internal/src/mutable/index.ts +17 -0
- package/internal/src/mutable/is-atom-token-mutable.ts +7 -0
- package/internal/src/mutable/tracker-family.ts +61 -0
- package/internal/src/mutable/tracker.ts +164 -0
- package/internal/src/mutable/transceiver.ts +110 -0
- package/internal/src/operation.ts +68 -0
- package/{src/internal → internal/src}/selector/create-read-write-selector.ts +10 -13
- package/{src/internal → internal/src}/selector/create-readonly-selector.ts +9 -8
- package/internal/src/selector/create-selector.ts +65 -0
- package/{src/internal → internal/src}/selector/index.ts +1 -0
- package/internal/src/selector/lookup-selector-sources.ts +20 -0
- package/{src/internal → internal/src}/selector/register-selector.ts +13 -9
- package/{src/internal → internal/src}/selector/trace-selector-atoms.ts +4 -2
- package/{src/internal → internal/src}/selector/update-selector-atoms.ts +4 -3
- package/internal/src/set-state/become.ts +10 -0
- package/internal/src/set-state/copy-mutable-if-needed.ts +23 -0
- package/internal/src/set-state/copy-mutable-in-transaction.ts +59 -0
- package/internal/src/set-state/copy-mutable-into-new-store.ts +34 -0
- package/internal/src/set-state/emit-update.ts +23 -0
- package/internal/src/set-state/evict-downstream.ts +39 -0
- package/internal/src/set-state/index.ts +2 -0
- package/internal/src/set-state/set-atom-state.ts +38 -0
- package/internal/src/set-state/set-selector-state.ts +19 -0
- package/internal/src/set-state/set-state-internal.ts +18 -0
- package/internal/src/set-state/stow-update.ts +42 -0
- package/internal/src/store/deposit.ts +43 -0
- package/internal/src/store/index.ts +5 -0
- package/internal/src/store/lookup.ts +26 -0
- package/internal/src/store/store.ts +154 -0
- package/internal/src/store/withdraw-new-family-member.ts +53 -0
- package/internal/src/store/withdraw.ts +113 -0
- package/internal/src/subject.ts +21 -0
- package/internal/src/subscribe/index.ts +1 -0
- package/internal/src/subscribe/recall-state.ts +19 -0
- package/internal/src/subscribe/subscribe-to-root-atoms.ts +47 -0
- package/{src/internal → internal/src}/timeline/add-atom-to-timeline.ts +50 -29
- package/internal/src/timeline/index.ts +3 -0
- package/{src/internal → internal/src/timeline}/time-travel-internal.ts +6 -6
- package/{src/internal → internal/src/timeline}/timeline-internal.ts +20 -12
- package/{src/internal → internal/src}/transaction/abort-transaction.ts +1 -1
- package/{src/internal → internal/src}/transaction/apply-transaction.ts +25 -18
- package/{src/internal → internal/src}/transaction/build-transaction.ts +12 -6
- package/{src/internal → internal/src}/transaction/index.ts +3 -2
- package/{src/internal → internal/src}/transaction/redo-transaction.ts +4 -5
- package/{src/internal → internal/src/transaction}/transaction-internal.ts +16 -13
- package/{src/internal → internal/src}/transaction/undo-transaction.ts +4 -5
- package/introspection/dist/index.d.mts +12 -260
- package/introspection/dist/index.d.ts +12 -260
- package/introspection/dist/index.js +125 -140
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/index.mjs +103 -116
- package/introspection/dist/index.mjs.map +1 -1
- package/{src/introspection → introspection/src}/attach-atom-index.ts +41 -30
- package/{src/introspection → introspection/src}/attach-introspection-states.ts +6 -10
- package/introspection/src/attach-selector-index.ts +90 -0
- package/{src/introspection → introspection/src}/attach-timeline-family.ts +16 -16
- package/introspection/src/attach-timeline-index.ts +38 -0
- package/introspection/src/attach-transaction-index.ts +40 -0
- package/{src/introspection → introspection/src}/attach-transaction-logs.ts +11 -8
- package/json/dist/index.d.mts +41 -2
- package/json/dist/index.d.ts +41 -2
- package/json/dist/index.js +88 -48
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs +76 -13
- package/json/dist/index.mjs.map +1 -1
- package/json/src/index.ts +5 -0
- package/json/src/select-json-family.ts +35 -0
- package/json/src/select-json.ts +22 -0
- package/package.json +105 -57
- package/react/dist/index.d.mts +9 -17
- package/react/dist/index.d.ts +9 -17
- package/react/dist/index.js +45 -77
- package/react/dist/index.js.map +1 -1
- package/react/dist/index.mjs +18 -34
- package/react/dist/index.mjs.map +1 -1
- package/react/src/store-context.tsx +12 -0
- package/react/src/store-hooks.ts +36 -0
- package/react-devtools/dist/index.css +1 -1
- package/react-devtools/dist/index.css.map +1 -1
- package/react-devtools/dist/index.d.mts +199 -230
- package/react-devtools/dist/index.d.ts +199 -230
- package/react-devtools/dist/index.js +610 -2466
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs +543 -2401
- package/react-devtools/dist/index.mjs.map +1 -1
- package/{src/react-devtools → react-devtools/src}/AtomIODevtools.tsx +5 -3
- package/{src/react-devtools → react-devtools/src}/Button.tsx +2 -3
- package/{src/react-devtools → react-devtools/src}/StateEditor.tsx +3 -2
- package/{src/react-devtools → react-devtools/src}/StateIndex.tsx +7 -4
- package/{src/react-devtools → react-devtools/src}/TimelineIndex.tsx +7 -11
- package/{src/react-devtools → react-devtools/src}/TransactionIndex.tsx +4 -4
- package/{src/react-devtools → react-devtools/src}/Updates.tsx +9 -4
- package/{src/react-devtools → react-devtools/src}/index.ts +5 -5
- package/realtime-react/dist/index.d.mts +9 -25
- package/realtime-react/dist/index.d.ts +9 -25
- package/realtime-react/dist/index.js +75 -193
- package/realtime-react/dist/index.js.map +1 -1
- package/realtime-react/dist/index.mjs +44 -148
- package/realtime-react/dist/index.mjs.map +1 -1
- package/realtime-react/src/index.ts +7 -0
- package/{src/realtime-react → realtime-react/src}/realtime-context.tsx +3 -4
- package/realtime-react/src/use-pull-family-member.ts +15 -0
- package/realtime-react/src/use-pull-mutable-family-member.ts +20 -0
- package/realtime-react/src/use-pull-mutable.ts +17 -0
- package/realtime-react/src/use-pull.ts +15 -0
- package/realtime-react/src/use-push.ts +19 -0
- package/realtime-react/src/use-server-action.ts +18 -0
- package/realtime-testing/dist/index.d.mts +49 -0
- package/realtime-testing/dist/index.d.ts +49 -0
- package/realtime-testing/dist/index.js +147 -0
- package/realtime-testing/dist/index.js.map +1 -0
- package/realtime-testing/dist/index.mjs +116 -0
- package/realtime-testing/dist/index.mjs.map +1 -0
- package/{src/realtime-testing → realtime-testing/src}/setup-realtime-test.tsx +10 -8
- package/src/atom.ts +64 -8
- package/src/index.ts +36 -29
- package/src/logger.ts +7 -7
- package/src/selector.ts +5 -5
- package/src/silo.ts +49 -43
- package/src/subscribe.ts +27 -22
- package/src/timeline.ts +9 -4
- package/src/transaction.ts +3 -4
- package/transceivers/set-rtx/dist/index.d.mts +39 -0
- package/transceivers/set-rtx/dist/index.d.ts +39 -0
- package/transceivers/set-rtx/dist/index.js +213 -0
- package/transceivers/set-rtx/dist/index.js.map +1 -0
- package/transceivers/set-rtx/dist/index.mjs +211 -0
- package/transceivers/set-rtx/dist/index.mjs.map +1 -0
- package/{realtime → transceivers/set-rtx}/package.json +1 -1
- package/transceivers/set-rtx/src/index.ts +1 -0
- package/transceivers/set-rtx/src/set-rtx.ts +242 -0
- package/realtime/dist/index.d.mts +0 -25
- package/realtime/dist/index.d.ts +0 -25
- package/realtime/dist/index.js +0 -190
- package/realtime/dist/index.js.map +0 -1
- package/realtime/dist/index.mjs +0 -151
- package/realtime/dist/index.mjs.map +0 -1
- package/src/internal/atom-internal.ts +0 -54
- package/src/internal/families-internal.ts +0 -144
- package/src/internal/get.ts +0 -129
- package/src/internal/index.ts +0 -15
- package/src/internal/operation.ts +0 -139
- package/src/internal/selector/lookup-selector-sources.ts +0 -16
- package/src/internal/selector-internal.ts +0 -58
- package/src/internal/set.ts +0 -99
- package/src/internal/store.ts +0 -151
- package/src/internal/subscribe-internal.ts +0 -88
- package/src/internal/timeline/index.ts +0 -1
- package/src/introspection/attach-selector-index.ts +0 -77
- package/src/introspection/attach-timeline-index.ts +0 -36
- package/src/introspection/attach-transaction-index.ts +0 -38
- package/src/json/index.ts +0 -1
- package/src/json/select-json.ts +0 -18
- package/src/react/store-context.tsx +0 -13
- package/src/react/store-hooks.ts +0 -47
- package/src/react-explorer/AtomIOExplorer.tsx +0 -218
- package/src/react-explorer/explorer-effects.ts +0 -20
- package/src/react-explorer/explorer-states.ts +0 -217
- package/src/react-explorer/index.ts +0 -23
- package/src/react-explorer/space-states.ts +0 -72
- package/src/react-explorer/view-states.ts +0 -41
- package/src/realtime/README.md +0 -33
- package/src/realtime/hook-composition/expose-family.ts +0 -101
- package/src/realtime/hook-composition/expose-single.ts +0 -38
- package/src/realtime/hook-composition/expose-timeline.ts +0 -60
- package/src/realtime/hook-composition/index.ts +0 -12
- package/src/realtime/hook-composition/receive-state.ts +0 -29
- package/src/realtime/hook-composition/receive-transaction.ts +0 -18
- package/src/realtime/index.ts +0 -1
- package/src/realtime-react/index.ts +0 -3
- package/src/realtime-react/realtime-hooks.ts +0 -39
- package/src/realtime-react/realtime-state.ts +0 -10
- package/src/realtime-react/use-pull-family-member.ts +0 -26
- package/src/realtime-react/use-pull-family.ts +0 -24
- package/src/realtime-react/use-pull.ts +0 -24
- package/src/realtime-react/use-push.ts +0 -27
- package/src/realtime-react/use-server-action.ts +0 -33
- package/src/tracker/index.ts +0 -3
- package/src/tracker/tracker.ts +0 -61
- package/src/web-effects/index.ts +0 -1
- package/src/web-effects/storage.ts +0 -30
- /package/{src/introspection → introspection/src}/index.ts +0 -0
- /package/{src/react → react/src}/index.ts +0 -0
- /package/{src/react-devtools → react-devtools/src}/devtools.scss +0 -0
- /package/{src/realtime-testing → realtime-testing/src}/index.ts +0 -0
|
@@ -1,27 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import { io } from
|
|
1
|
+
import { useI, StoreContext } from 'atom.io/react';
|
|
2
|
+
import * as RTC from 'atom.io/realtime-client';
|
|
3
|
+
import * as React6 from 'react';
|
|
4
|
+
import { io } from 'socket.io-client';
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
6
|
+
import * as AtomIO from 'atom.io';
|
|
5
7
|
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
var myIdState__INTERNAL = AtomIO.atom({
|
|
9
|
-
key: `myId__INTERNAL`,
|
|
10
|
-
default: null
|
|
11
|
-
});
|
|
12
|
-
var myIdState = AtomIO.selector({
|
|
13
|
-
key: `myId`,
|
|
14
|
-
get: ({ get }) => get(myIdState__INTERNAL)
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// ../src/realtime-react/realtime-context.tsx
|
|
18
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
19
|
-
var RealtimeContext = React.createContext({
|
|
8
|
+
// src/realtime-context.tsx
|
|
9
|
+
var RealtimeContext = React6.createContext({
|
|
20
10
|
socket: io()
|
|
21
11
|
});
|
|
22
12
|
var RealtimeProvider = ({ children, socket }) => {
|
|
23
|
-
const setMyId =
|
|
24
|
-
|
|
13
|
+
const setMyId = useI(RTC.myIdState__INTERNAL);
|
|
14
|
+
React6.useEffect(() => {
|
|
25
15
|
socket.on(`connect`, () => {
|
|
26
16
|
setMyId(socket.id);
|
|
27
17
|
});
|
|
@@ -29,144 +19,50 @@ var RealtimeProvider = ({ children, socket }) => {
|
|
|
29
19
|
setMyId(null);
|
|
30
20
|
});
|
|
31
21
|
}, [socket, setMyId]);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
fileName: "../src/realtime-react/realtime-context.tsx",
|
|
34
|
-
lineNumber: 26,
|
|
35
|
-
columnNumber: 3
|
|
36
|
-
}, this);
|
|
22
|
+
return /* @__PURE__ */ jsx(RealtimeContext.Provider, { value: { socket }, children });
|
|
37
23
|
};
|
|
38
|
-
|
|
39
|
-
// ../src/realtime-react/use-pull.ts
|
|
40
|
-
import * as AtomIO3 from "atom.io";
|
|
41
|
-
import * as React3 from "react";
|
|
42
|
-
|
|
43
|
-
// ../src/react/store-context.tsx
|
|
44
|
-
import * as AtomIO2 from "atom.io";
|
|
45
|
-
import * as React2 from "react";
|
|
46
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
47
|
-
var StoreContext = React2.createContext(
|
|
48
|
-
AtomIO2.__INTERNAL__.IMPLICIT.STORE
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
// ../src/realtime-react/use-pull.ts
|
|
52
24
|
function usePull(token) {
|
|
53
|
-
const { socket } =
|
|
54
|
-
const store =
|
|
55
|
-
|
|
56
|
-
socket.on(`serve:${token.key}`, (data) => {
|
|
57
|
-
AtomIO3.setState(token, data, store);
|
|
58
|
-
});
|
|
59
|
-
socket.emit(`sub:${token.key}`);
|
|
60
|
-
return () => {
|
|
61
|
-
socket.off(`serve:${token.key}`);
|
|
62
|
-
socket.emit(`unsub:${token.key}`);
|
|
63
|
-
};
|
|
64
|
-
}, [token.key]);
|
|
25
|
+
const { socket } = React6.useContext(RealtimeContext);
|
|
26
|
+
const store = React6.useContext(StoreContext);
|
|
27
|
+
React6.useEffect(() => RTC.pullState(token, socket, store), [token.key]);
|
|
65
28
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function usePullFamily(family) {
|
|
71
|
-
const { socket } = React4.useContext(RealtimeContext);
|
|
72
|
-
const store = React4.useContext(StoreContext);
|
|
73
|
-
React4.useEffect(() => {
|
|
74
|
-
socket.on(`serve:${family.key}`, (key, data) => {
|
|
75
|
-
AtomIO4.setState(family(key), data, store);
|
|
76
|
-
});
|
|
77
|
-
socket == null ? void 0 : socket.emit(`sub:${family.key}`);
|
|
78
|
-
return () => {
|
|
79
|
-
socket == null ? void 0 : socket.off(`serve:${family.key}`);
|
|
80
|
-
socket == null ? void 0 : socket.emit(`unsub:${family.key}`);
|
|
81
|
-
};
|
|
82
|
-
}, [family.key]);
|
|
29
|
+
function usePullFamilyMember(token) {
|
|
30
|
+
const { socket } = React6.useContext(RealtimeContext);
|
|
31
|
+
const store = React6.useContext(StoreContext);
|
|
32
|
+
React6.useEffect(() => RTC.pullFamilyMember(token, socket, store), [token.key]);
|
|
83
33
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const { socket } =
|
|
91
|
-
const store =
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
socket == null ? void 0 : socket.emit(`sub:${family.key}`, subKey);
|
|
97
|
-
return () => {
|
|
98
|
-
socket == null ? void 0 : socket.off(`serve:${token.key}`);
|
|
99
|
-
socket == null ? void 0 : socket.emit(`unsub:${token.key}`);
|
|
100
|
-
};
|
|
101
|
-
}, [family.key]);
|
|
34
|
+
function usePullMutable(token) {
|
|
35
|
+
const { socket } = React6.useContext(RealtimeContext);
|
|
36
|
+
const store = React6.useContext(StoreContext);
|
|
37
|
+
React6.useEffect(() => RTC.pullMutableState(token, socket, store), [token.key]);
|
|
38
|
+
}
|
|
39
|
+
function usePullMutableFamilyMember(token) {
|
|
40
|
+
const { socket } = React6.useContext(RealtimeContext);
|
|
41
|
+
const store = React6.useContext(StoreContext);
|
|
42
|
+
React6.useEffect(
|
|
43
|
+
() => RTC.pullMutableFamilyMember(token, socket, store),
|
|
44
|
+
[token.key]
|
|
45
|
+
);
|
|
102
46
|
}
|
|
103
|
-
|
|
104
|
-
// ../src/realtime-react/use-push.ts
|
|
105
|
-
import * as AtomIO6 from "atom.io";
|
|
106
|
-
import * as React6 from "react";
|
|
107
47
|
function usePush(token) {
|
|
108
48
|
const { socket } = React6.useContext(RealtimeContext);
|
|
109
49
|
const store = React6.useContext(StoreContext);
|
|
110
|
-
React6.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
socket.emit(`pub:${token.key}`, newValue);
|
|
116
|
-
},
|
|
117
|
-
store
|
|
118
|
-
);
|
|
119
|
-
return () => {
|
|
120
|
-
socket.emit(`unclaim:${token.key}`);
|
|
121
|
-
};
|
|
122
|
-
}, [token.key]);
|
|
50
|
+
const id = React6.useId();
|
|
51
|
+
React6.useEffect(
|
|
52
|
+
() => RTC.pushState(token, socket, `use-push:${id}`, store),
|
|
53
|
+
[token.key]
|
|
54
|
+
);
|
|
123
55
|
}
|
|
124
|
-
|
|
125
|
-
// ../src/realtime-react/use-server-action.ts
|
|
126
|
-
import * as AtomIO7 from "atom.io";
|
|
127
|
-
import { StoreContext as StoreContext2 } from "atom.io/react";
|
|
128
|
-
import * as React7 from "react";
|
|
129
|
-
var TX_SUBS = /* @__PURE__ */ new Map();
|
|
130
56
|
function useServerAction(token) {
|
|
131
|
-
const store =
|
|
132
|
-
const { socket } =
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
token,
|
|
139
|
-
(update) => socket.emit(`tx:${token.key}`, update),
|
|
140
|
-
store
|
|
141
|
-
) : () => null;
|
|
142
|
-
return () => {
|
|
143
|
-
var _a2;
|
|
144
|
-
const newCount = (_a2 = TX_SUBS.get(token.key)) != null ? _a2 : 0;
|
|
145
|
-
TX_SUBS.set(token.key, newCount - 1);
|
|
146
|
-
unsubscribe();
|
|
147
|
-
};
|
|
148
|
-
}, [token.key]);
|
|
149
|
-
return AtomIO7.runTransaction(token, store);
|
|
57
|
+
const store = React6.useContext(StoreContext);
|
|
58
|
+
const { socket } = React6.useContext(RealtimeContext);
|
|
59
|
+
React6.useEffect(
|
|
60
|
+
() => RTC.synchronizeTransactionResults(token, socket, store),
|
|
61
|
+
[token.key]
|
|
62
|
+
);
|
|
63
|
+
return AtomIO.runTransaction(token, store);
|
|
150
64
|
}
|
|
151
65
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
usePull,
|
|
155
|
-
usePullFamily,
|
|
156
|
-
usePullFamilyMember,
|
|
157
|
-
usePush,
|
|
158
|
-
useServerAction
|
|
159
|
-
};
|
|
160
|
-
export {
|
|
161
|
-
RealtimeContext,
|
|
162
|
-
RealtimeProvider,
|
|
163
|
-
myIdState,
|
|
164
|
-
myIdState__INTERNAL,
|
|
165
|
-
realtimeHooks,
|
|
166
|
-
usePull,
|
|
167
|
-
usePullFamily,
|
|
168
|
-
usePullFamilyMember,
|
|
169
|
-
usePush,
|
|
170
|
-
useServerAction
|
|
171
|
-
};
|
|
66
|
+
export { RealtimeContext, RealtimeProvider, usePull, usePullFamilyMember, usePullMutable, usePullMutableFamilyMember, usePush, useServerAction };
|
|
67
|
+
//# sourceMappingURL=out.js.map
|
|
172
68
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/realtime-react/realtime-context.tsx","../../src/realtime-react/realtime-state.ts","../../src/realtime-react/use-pull.ts","../../src/react/store-context.tsx","../../src/realtime-react/use-pull-family.ts","../../src/realtime-react/use-pull-family-member.ts","../../src/realtime-react/use-push.ts","../../src/realtime-react/use-server-action.ts","../../src/realtime-react/realtime-hooks.ts"],"sourcesContent":["import * as AR from \"atom.io/react\"\nimport * as React from \"react\"\nimport type { Socket } from \"socket.io-client\"\nimport { io } from \"socket.io-client\"\n\nimport { myIdState__INTERNAL } from \"./realtime-state\"\n\nexport const RealtimeContext = React.createContext<{ socket: Socket }>({\n\tsocket: io(),\n})\n\nexport const RealtimeProvider: React.FC<{\n\tchildren: React.ReactNode\n\tsocket: Socket\n}> = ({ children, socket }) => {\n\tconst setMyId = AR.useI(myIdState__INTERNAL)\n\tReact.useEffect(() => {\n\t\tsocket.on(`connect`, () => {\n\t\t\tsetMyId(socket.id)\n\t\t})\n\t\tsocket.on(`disconnect`, () => {\n\t\t\tsetMyId(null)\n\t\t})\n\t}, [socket, setMyId])\n\treturn (\n\t\t<RealtimeContext.Provider value={{ socket }}>\n\t\t\t{children}\n\t\t</RealtimeContext.Provider>\n\t)\n}\n","import * as AtomIO from \"atom.io\"\n\nexport const myIdState__INTERNAL = AtomIO.atom<string | null>({\n\tkey: `myId__INTERNAL`,\n\tdefault: null,\n})\nexport const myIdState = AtomIO.selector<string | null>({\n\tkey: `myId`,\n\tget: ({ get }) => get(myIdState__INTERNAL),\n})\n","import * as AtomIO from \"atom.io\"\nimport * as React from \"react\"\n\nimport type { Json } from \"~/packages/anvl/src/json\"\n\nimport { RealtimeContext } from \"./realtime-context\"\nimport { StoreContext } from \"../react\"\n\nexport function usePull<J extends Json.Serializable>(\n\ttoken: AtomIO.StateToken<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => {\n\t\tsocket.on(`serve:${token.key}`, (data: J) => {\n\t\t\tAtomIO.setState(token, data, store)\n\t\t})\n\t\tsocket.emit(`sub:${token.key}`)\n\t\treturn () => {\n\t\t\tsocket.off(`serve:${token.key}`)\n\t\t\tsocket.emit(`unsub:${token.key}`)\n\t\t}\n\t}, [token.key])\n}\n","import * as AtomIO from \"atom.io\"\nimport * as React from \"react\"\n\nexport const StoreContext = React.createContext<AtomIO.Store>(\n\tAtomIO.__INTERNAL__.IMPLICIT.STORE,\n)\n\nexport const StoreProvider: React.FC<{\n\tchildren: React.ReactNode\n\tstore?: AtomIO.Store\n}> = ({ children, store = AtomIO.__INTERNAL__.IMPLICIT.STORE }) => (\n\t<StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n)\n","import * as AtomIO from \"atom.io\"\nimport * as React from \"react\"\n\nimport type { Json } from \"~/packages/anvl/src/json\"\n\nimport { RealtimeContext } from \"./realtime-context\"\nimport { StoreContext } from \"../react\"\n\nexport function usePullFamily<J extends Json.Serializable>(\n\tfamily: AtomIO.AtomFamily<J> | AtomIO.SelectorFamily<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => {\n\t\tsocket.on(`serve:${family.key}`, (key: Json.Serializable, data: J) => {\n\t\t\tAtomIO.setState(family(key), data, store)\n\t\t})\n\t\tsocket?.emit(`sub:${family.key}`)\n\t\treturn () => {\n\t\t\tsocket?.off(`serve:${family.key}`)\n\t\t\tsocket?.emit(`unsub:${family.key}`)\n\t\t}\n\t}, [family.key])\n}\n","import * as AtomIO from \"atom.io\"\nimport * as React from \"react\"\n\nimport type { Json } from \"~/packages/anvl/src/json\"\n\nimport { RealtimeContext } from \"./realtime-context\"\nimport { StoreContext } from \"../react\"\n\nexport function usePullFamilyMember<J extends Json.Serializable>(\n\tfamily: AtomIO.AtomFamily<J> | AtomIO.SelectorFamily<J>,\n\tsubKey: AtomIO.Json.Serializable,\n): void {\n\tconst token = family(subKey)\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => {\n\t\tsocket?.on(`serve:${token.key}`, (data: J) => {\n\t\t\tAtomIO.setState(family(subKey), data, store)\n\t\t})\n\t\tsocket?.emit(`sub:${family.key}`, subKey)\n\t\treturn () => {\n\t\t\tsocket?.off(`serve:${token.key}`)\n\t\t\tsocket?.emit(`unsub:${token.key}`)\n\t\t}\n\t}, [family.key])\n}\n","import * as AtomIO from \"atom.io\"\nimport * as React from \"react\"\n\nimport type { Json } from \"~/packages/anvl/src/json\"\n\nimport { RealtimeContext } from \"./realtime-context\"\nimport { StoreContext } from \"../react\"\n\nexport function usePush<J extends Json.Serializable>(\n\ttoken: AtomIO.StateToken<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => {\n\t\tsocket.emit(`claim:${token.key}`)\n\t\tAtomIO.subscribe(\n\t\t\ttoken,\n\t\t\t({ newValue }) => {\n\t\t\t\tsocket.emit(`pub:${token.key}`, newValue)\n\t\t\t},\n\t\t\tstore,\n\t\t)\n\t\treturn () => {\n\t\t\tsocket.emit(`unclaim:${token.key}`)\n\t\t}\n\t}, [token.key])\n}\n","import * as AtomIO from \"atom.io\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as React from \"react\"\n\nimport type { ƒn } from \"~/packages/anvl/src/function\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nconst TX_SUBS = new Map<string, number>()\nexport function useServerAction<ƒ extends ƒn>(\n\ttoken: AtomIO.TransactionToken<ƒ>,\n): (...parameters: Parameters<ƒ>) => ReturnType<ƒ> {\n\tconst store = React.useContext(StoreContext)\n\tconst { socket } = React.useContext(RealtimeContext)\n\tReact.useEffect(() => {\n\t\tconst count = TX_SUBS.get(token.key) ?? 0\n\t\tTX_SUBS.set(token.key, count + 1)\n\t\tconst unsubscribe =\n\t\t\tcount === 0\n\t\t\t\t? AtomIO.subscribeToTransaction(\n\t\t\t\t\t\ttoken,\n\t\t\t\t\t\t(update) => socket.emit(`tx:${token.key}`, update),\n\t\t\t\t\t\tstore,\n\t\t\t\t )\n\t\t\t\t: () => null\n\t\treturn () => {\n\t\t\tconst newCount = TX_SUBS.get(token.key) ?? 0\n\t\t\tTX_SUBS.set(token.key, newCount - 1)\n\t\t\tunsubscribe()\n\t\t}\n\t}, [token.key])\n\treturn AtomIO.runTransaction(token, store)\n}\n","import type * as AtomIO from \"atom.io\"\n\nimport type { ƒn } from \"~/packages/anvl/src/function\"\nimport type { Json } from \"~/packages/anvl/src/json\"\n\nimport { usePull } from \"./use-pull\"\nimport { usePullFamily } from \"./use-pull-family\"\nimport { usePullFamilyMember } from \"./use-pull-family-member\"\nimport { usePush } from \"./use-push\"\nimport { useServerAction } from \"./use-server-action\"\n\nexport type RealtimeHooks = {\n\tusePull: <J extends Json.Serializable>(token: AtomIO.StateToken<J>) => void\n\tusePullFamily: <J extends Json.Serializable>(\n\t\tfamily: AtomIO.AtomFamily<J> | AtomIO.SelectorFamily<J>,\n\t) => void\n\tusePullFamilyMember: <J extends Json.Serializable>(\n\t\tfamily: AtomIO.AtomFamily<J> | AtomIO.SelectorFamily<J>,\n\t\tsubKey: string,\n\t) => void\n\tusePush: <J extends Json.Serializable>(token: AtomIO.StateToken<J>) => void\n\tuseServerAction: <ƒ extends ƒn>(\n\t\ttoken: AtomIO.TransactionToken<ƒ>,\n\t) => (...parameters: Parameters<ƒ>) => ReturnType<ƒ>\n}\n\nexport const realtimeHooks: RealtimeHooks = {\n\tusePull,\n\tusePullFamily,\n\tusePullFamilyMember,\n\tusePush,\n\tuseServerAction,\n}\n\nexport * from \"./use-pull\"\nexport * from \"./use-pull-family\"\nexport * from \"./use-pull-family-member\"\nexport * from \"./use-push\"\nexport * from \"./use-server-action\"\n"],"mappings":";AAAA,YAAY,QAAQ;AACpB,YAAY,WAAW;AAEvB,SAAS,UAAU;;;ACHnB,YAAY,YAAY;AAEjB,IAAM,sBAA6B,YAAoB;AAAA,EAC7D,KAAK;AAAA,EACL,SAAS;AACV,CAAC;AACM,IAAM,YAAmB,gBAAwB;AAAA,EACvD,KAAK;AAAA,EACL,KAAK,CAAC,EAAE,IAAI,MAAM,IAAI,mBAAmB;AAC1C,CAAC;;;ADgBC;AAlBK,IAAM,kBAAwB,oBAAkC;AAAA,EACtE,QAAQ,GAAG;AACZ,CAAC;AAEM,IAAM,mBAGR,CAAC,EAAE,UAAU,OAAO,MAAM;AAC9B,QAAM,UAAa,QAAK,mBAAmB;AAC3C,EAAM,gBAAU,MAAM;AACrB,WAAO,GAAG,WAAW,MAAM;AAC1B,cAAQ,OAAO,EAAE;AAAA,IAClB,CAAC;AACD,WAAO,GAAG,cAAc,MAAM;AAC7B,cAAQ,IAAI;AAAA,IACb,CAAC;AAAA,EACF,GAAG,CAAC,QAAQ,OAAO,CAAC;AACpB,SACC,uBAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,OAAO,GACxC,YADF;AAAA;AAAA;AAAA;AAAA,SAEA;AAEF;;;AE7BA,YAAYA,aAAY;AACxB,YAAYC,YAAW;;;ACDvB,YAAYC,aAAY;AACxB,YAAYC,YAAW;AAUtB,mBAAAC,eAAA;AARM,IAAM,eAAqB;AAAA,EAC1B,qBAAa,SAAS;AAC9B;;;ADGO,SAAS,QACf,OACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAW,YAAY;AAC3C,EAAM,iBAAU,MAAM;AACrB,WAAO,GAAG,SAAS,MAAM,GAAG,IAAI,CAAC,SAAY;AAC5C,MAAO,iBAAS,OAAO,MAAM,KAAK;AAAA,IACnC,CAAC;AACD,WAAO,KAAK,OAAO,MAAM,GAAG,EAAE;AAC9B,WAAO,MAAM;AACZ,aAAO,IAAI,SAAS,MAAM,GAAG,EAAE;AAC/B,aAAO,KAAK,SAAS,MAAM,GAAG,EAAE;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,MAAM,GAAG,CAAC;AACf;;;AEvBA,YAAYC,aAAY;AACxB,YAAYC,YAAW;AAOhB,SAAS,cACf,QACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAW,YAAY;AAC3C,EAAM,iBAAU,MAAM;AACrB,WAAO,GAAG,SAAS,OAAO,GAAG,IAAI,CAAC,KAAwB,SAAY;AACrE,MAAO,iBAAS,OAAO,GAAG,GAAG,MAAM,KAAK;AAAA,IACzC,CAAC;AACD,qCAAQ,KAAK,OAAO,OAAO,GAAG;AAC9B,WAAO,MAAM;AACZ,uCAAQ,IAAI,SAAS,OAAO,GAAG;AAC/B,uCAAQ,KAAK,SAAS,OAAO,GAAG;AAAA,IACjC;AAAA,EACD,GAAG,CAAC,OAAO,GAAG,CAAC;AAChB;;;ACvBA,YAAYC,aAAY;AACxB,YAAYC,YAAW;AAOhB,SAAS,oBACf,QACA,QACO;AACP,QAAM,QAAQ,OAAO,MAAM;AAC3B,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAW,YAAY;AAC3C,EAAM,iBAAU,MAAM;AACrB,qCAAQ,GAAG,SAAS,MAAM,GAAG,IAAI,CAAC,SAAY;AAC7C,MAAO,iBAAS,OAAO,MAAM,GAAG,MAAM,KAAK;AAAA,IAC5C;AACA,qCAAQ,KAAK,OAAO,OAAO,GAAG,IAAI;AAClC,WAAO,MAAM;AACZ,uCAAQ,IAAI,SAAS,MAAM,GAAG;AAC9B,uCAAQ,KAAK,SAAS,MAAM,GAAG;AAAA,IAChC;AAAA,EACD,GAAG,CAAC,OAAO,GAAG,CAAC;AAChB;;;ACzBA,YAAYC,aAAY;AACxB,YAAYC,YAAW;AAOhB,SAAS,QACf,OACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAW,YAAY;AAC3C,EAAM,iBAAU,MAAM;AACrB,WAAO,KAAK,SAAS,MAAM,GAAG,EAAE;AAChC,IAAO;AAAA,MACN;AAAA,MACA,CAAC,EAAE,SAAS,MAAM;AACjB,eAAO,KAAK,OAAO,MAAM,GAAG,IAAI,QAAQ;AAAA,MACzC;AAAA,MACA;AAAA,IACD;AACA,WAAO,MAAM;AACZ,aAAO,KAAK,WAAW,MAAM,GAAG,EAAE;AAAA,IACnC;AAAA,EACD,GAAG,CAAC,MAAM,GAAG,CAAC;AACf;;;AC1BA,YAAYC,aAAY;AACxB,SAAS,gBAAAC,qBAAoB;AAC7B,YAAYC,YAAW;AAMvB,IAAM,UAAU,oBAAI,IAAoB;AACjC,SAAS,gBACf,OACkD;AAClD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,EAAM,iBAAU,MAAM;AAdvB;AAeE,UAAM,SAAQ,aAAQ,IAAI,MAAM,GAAG,MAArB,YAA0B;AACxC,YAAQ,IAAI,MAAM,KAAK,QAAQ,CAAC;AAChC,UAAM,cACL,UAAU,IACA;AAAA,MACP;AAAA,MACA,CAAC,WAAW,OAAO,KAAK,MAAM,MAAM,GAAG,IAAI,MAAM;AAAA,MACjD;AAAA,IACA,IACA,MAAM;AACV,WAAO,MAAM;AAzBf,UAAAC;AA0BG,YAAM,YAAWA,MAAA,QAAQ,IAAI,MAAM,GAAG,MAArB,OAAAA,MAA0B;AAC3C,cAAQ,IAAI,MAAM,KAAK,WAAW,CAAC;AACnC,kBAAY;AAAA,IACb;AAAA,EACD,GAAG,CAAC,MAAM,GAAG,CAAC;AACd,SAAc,uBAAe,OAAO,KAAK;AAC1C;;;ACNO,IAAM,gBAA+B;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;","names":["AtomIO","React","AtomIO","React","jsxDEV","AtomIO","React","AtomIO","React","AtomIO","React","AtomIO","StoreContext","React","StoreContext","_a"]}
|
|
1
|
+
{"version":3,"sources":["../src/realtime-context.tsx","../src/use-pull.ts","../src/use-pull-family-member.ts","../src/use-pull-mutable.ts","../src/use-pull-mutable-family-member.ts","../src/use-push.ts","../src/use-server-action.ts"],"names":["RTC","React","StoreContext"],"mappings":";AAAA,SAAS,YAAY;AACrB,YAAY,SAAS;AACrB,YAAY,WAAW;AAEvB,SAAS,UAAU;AAoBjB;AAlBK,IAAM,kBAAwB,oBAAkC;AAAA,EACtE,QAAQ,GAAG;AACZ,CAAC;AAEM,IAAM,mBAGR,CAAC,EAAE,UAAU,OAAO,MAAM;AAC9B,QAAM,UAAU,KAAS,uBAAmB;AAC5C,EAAM,gBAAU,MAAM;AACrB,WAAO,GAAG,WAAW,MAAM;AAC1B,cAAQ,OAAO,EAAE;AAAA,IAClB,CAAC;AACD,WAAO,GAAG,cAAc,MAAM;AAC7B,cAAQ,IAAI;AAAA,IACb,CAAC;AAAA,EACF,GAAG,CAAC,QAAQ,OAAO,CAAC;AACpB,SACC,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,OAAO,GACxC,UACF;AAEF;;;AC1BA,SAAS,oBAAoB;AAC7B,YAAYA,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,QACf,OACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAW,YAAY;AAC3C,EAAM,iBAAU,MAAU,eAAU,OAAO,QAAQ,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;AACvE;;;ACZA,SAAS,gBAAAC,qBAAoB;AAC7B,YAAYF,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,oBACf,OACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,EAAM,iBAAU,MAAU,sBAAiB,OAAO,QAAQ,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;AAC9E;;;ACXA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYF,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,eAGd,OAA4C;AAC7C,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,EAAM,iBAAU,MAAU,sBAAiB,OAAO,QAAQ,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC;AAC9E;;;ACbA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYF,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,2BAGd,OAA4C;AAC7C,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,EAAM;AAAA,IACL,MAAU,6BAAwB,OAAO,QAAQ,KAAK;AAAA,IACtD,CAAC,MAAM,GAAG;AAAA,EACX;AACD;;;ACjBA,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYF,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,QACf,OACO;AACP,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,QAAM,KAAW,aAAM;AACvB,EAAM;AAAA,IACL,MAAU,eAAU,OAAO,QAAQ,YAAY,EAAE,IAAI,KAAK;AAAA,IAC1D,CAAC,MAAM,GAAG;AAAA,EACX;AACD;;;AClBA,YAAY,YAAY;AACxB,SAAS,gBAAAA,qBAAoB;AAC7B,YAAYF,UAAS;AACrB,YAAYC,YAAW;AAIhB,SAAS,gBACf,OACkD;AAClD,QAAM,QAAc,kBAAWC,aAAY;AAC3C,QAAM,EAAE,OAAO,IAAU,kBAAW,eAAe;AACnD,EAAM;AAAA,IACL,MAAU,mCAA8B,OAAO,QAAQ,KAAK;AAAA,IAC5D,CAAC,MAAM,GAAG;AAAA,EACX;AACA,SAAc,sBAAe,OAAO,KAAK;AAC1C","sourcesContent":["import { useI } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\nimport type { Socket } from \"socket.io-client\"\nimport { io } from \"socket.io-client\"\n\nexport const RealtimeContext = React.createContext<{ socket: Socket }>({\n\tsocket: io(),\n})\n\nexport const RealtimeProvider: React.FC<{\n\tchildren: React.ReactNode\n\tsocket: Socket\n}> = ({ children, socket }) => {\n\tconst setMyId = useI(RTC.myIdState__INTERNAL)\n\tReact.useEffect(() => {\n\t\tsocket.on(`connect`, () => {\n\t\t\tsetMyId(socket.id)\n\t\t})\n\t\tsocket.on(`disconnect`, () => {\n\t\t\tsetMyId(null)\n\t\t})\n\t}, [socket, setMyId])\n\treturn (\n\t\t<RealtimeContext.Provider value={{ socket }}>\n\t\t\t{children}\n\t\t</RealtimeContext.Provider>\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function usePull<J extends Json.Serializable>(\n\ttoken: AtomIO.StateToken<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => RTC.pullState(token, socket, store), [token.key])\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function usePullFamilyMember<J extends Json.Serializable>(\n\ttoken: AtomIO.AtomToken<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => RTC.pullFamilyMember(token, socket, store), [token.key])\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Transceiver } from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function usePullMutable<\n\tT extends Transceiver<Json.Serializable>,\n\tJ extends Json.Serializable,\n>(token: AtomIO.MutableAtomToken<T, J>): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(() => RTC.pullMutableState(token, socket, store), [token.key])\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Transceiver } from \"atom.io/internal\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function usePullMutableFamilyMember<\n\tT extends Transceiver<Json.Serializable>,\n\tJ extends Json.Serializable,\n>(token: AtomIO.MutableAtomToken<T, J>): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tReact.useEffect(\n\t\t() => RTC.pullMutableFamilyMember(token, socket, store),\n\t\t[token.key],\n\t)\n}\n","import type * as AtomIO from \"atom.io\"\nimport type { Json } from \"atom.io/json\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function usePush<J extends Json.Serializable>(\n\ttoken: AtomIO.StateToken<J>,\n): void {\n\tconst { socket } = React.useContext(RealtimeContext)\n\tconst store = React.useContext(StoreContext)\n\tconst id = React.useId()\n\tReact.useEffect(\n\t\t() => RTC.pushState(token, socket, `use-push:${id}`, store),\n\t\t[token.key],\n\t)\n}\n","import * as AtomIO from \"atom.io\"\nimport { StoreContext } from \"atom.io/react\"\nimport * as RTC from \"atom.io/realtime-client\"\nimport * as React from \"react\"\n\nimport { RealtimeContext } from \"./realtime-context\"\n\nexport function useServerAction<ƒ extends AtomIO.ƒn>(\n\ttoken: AtomIO.TransactionToken<ƒ>,\n): (...parameters: Parameters<ƒ>) => ReturnType<ƒ> {\n\tconst store = React.useContext(StoreContext)\n\tconst { socket } = React.useContext(RealtimeContext)\n\tReact.useEffect(\n\t\t() => RTC.synchronizeTransactionResults(token, socket, store),\n\t\t[token.key],\n\t)\n\treturn AtomIO.runTransaction(token, store)\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useI } from "atom.io/react"
|
|
2
|
+
import * as RTC from "atom.io/realtime-client"
|
|
2
3
|
import * as React from "react"
|
|
3
4
|
import type { Socket } from "socket.io-client"
|
|
4
5
|
import { io } from "socket.io-client"
|
|
5
6
|
|
|
6
|
-
import { myIdState__INTERNAL } from "./realtime-state"
|
|
7
|
-
|
|
8
7
|
export const RealtimeContext = React.createContext<{ socket: Socket }>({
|
|
9
8
|
socket: io(),
|
|
10
9
|
})
|
|
@@ -13,7 +12,7 @@ export const RealtimeProvider: React.FC<{
|
|
|
13
12
|
children: React.ReactNode
|
|
14
13
|
socket: Socket
|
|
15
14
|
}> = ({ children, socket }) => {
|
|
16
|
-
const setMyId =
|
|
15
|
+
const setMyId = useI(RTC.myIdState__INTERNAL)
|
|
17
16
|
React.useEffect(() => {
|
|
18
17
|
socket.on(`connect`, () => {
|
|
19
18
|
setMyId(socket.id)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Json } from "atom.io/json"
|
|
3
|
+
import { StoreContext } from "atom.io/react"
|
|
4
|
+
import * as RTC from "atom.io/realtime-client"
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
|
|
7
|
+
import { RealtimeContext } from "./realtime-context"
|
|
8
|
+
|
|
9
|
+
export function usePullFamilyMember<J extends Json.Serializable>(
|
|
10
|
+
token: AtomIO.AtomToken<J>,
|
|
11
|
+
): void {
|
|
12
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
13
|
+
const store = React.useContext(StoreContext)
|
|
14
|
+
React.useEffect(() => RTC.pullFamilyMember(token, socket, store), [token.key])
|
|
15
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Transceiver } from "atom.io/internal"
|
|
3
|
+
import type { Json } from "atom.io/json"
|
|
4
|
+
import { StoreContext } from "atom.io/react"
|
|
5
|
+
import * as RTC from "atom.io/realtime-client"
|
|
6
|
+
import * as React from "react"
|
|
7
|
+
|
|
8
|
+
import { RealtimeContext } from "./realtime-context"
|
|
9
|
+
|
|
10
|
+
export function usePullMutableFamilyMember<
|
|
11
|
+
T extends Transceiver<Json.Serializable>,
|
|
12
|
+
J extends Json.Serializable,
|
|
13
|
+
>(token: AtomIO.MutableAtomToken<T, J>): void {
|
|
14
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
15
|
+
const store = React.useContext(StoreContext)
|
|
16
|
+
React.useEffect(
|
|
17
|
+
() => RTC.pullMutableFamilyMember(token, socket, store),
|
|
18
|
+
[token.key],
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Transceiver } from "atom.io/internal"
|
|
3
|
+
import type { Json } from "atom.io/json"
|
|
4
|
+
import { StoreContext } from "atom.io/react"
|
|
5
|
+
import * as RTC from "atom.io/realtime-client"
|
|
6
|
+
import * as React from "react"
|
|
7
|
+
|
|
8
|
+
import { RealtimeContext } from "./realtime-context"
|
|
9
|
+
|
|
10
|
+
export function usePullMutable<
|
|
11
|
+
T extends Transceiver<Json.Serializable>,
|
|
12
|
+
J extends Json.Serializable,
|
|
13
|
+
>(token: AtomIO.MutableAtomToken<T, J>): void {
|
|
14
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
15
|
+
const store = React.useContext(StoreContext)
|
|
16
|
+
React.useEffect(() => RTC.pullMutableState(token, socket, store), [token.key])
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Json } from "atom.io/json"
|
|
3
|
+
import { StoreContext } from "atom.io/react"
|
|
4
|
+
import * as RTC from "atom.io/realtime-client"
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
|
|
7
|
+
import { RealtimeContext } from "./realtime-context"
|
|
8
|
+
|
|
9
|
+
export function usePull<J extends Json.Serializable>(
|
|
10
|
+
token: AtomIO.StateToken<J>,
|
|
11
|
+
): void {
|
|
12
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
13
|
+
const store = React.useContext(StoreContext)
|
|
14
|
+
React.useEffect(() => RTC.pullState(token, socket, store), [token.key])
|
|
15
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as AtomIO from "atom.io"
|
|
2
|
+
import type { Json } from "atom.io/json"
|
|
3
|
+
import { StoreContext } from "atom.io/react"
|
|
4
|
+
import * as RTC from "atom.io/realtime-client"
|
|
5
|
+
import * as React from "react"
|
|
6
|
+
|
|
7
|
+
import { RealtimeContext } from "./realtime-context"
|
|
8
|
+
|
|
9
|
+
export function usePush<J extends Json.Serializable>(
|
|
10
|
+
token: AtomIO.StateToken<J>,
|
|
11
|
+
): void {
|
|
12
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
13
|
+
const store = React.useContext(StoreContext)
|
|
14
|
+
const id = React.useId()
|
|
15
|
+
React.useEffect(
|
|
16
|
+
() => RTC.pushState(token, socket, `use-push:${id}`, store),
|
|
17
|
+
[token.key],
|
|
18
|
+
)
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as AtomIO from "atom.io"
|
|
2
|
+
import { StoreContext } from "atom.io/react"
|
|
3
|
+
import * as RTC from "atom.io/realtime-client"
|
|
4
|
+
import * as React from "react"
|
|
5
|
+
|
|
6
|
+
import { RealtimeContext } from "./realtime-context"
|
|
7
|
+
|
|
8
|
+
export function useServerAction<ƒ extends AtomIO.ƒn>(
|
|
9
|
+
token: AtomIO.TransactionToken<ƒ>,
|
|
10
|
+
): (...parameters: Parameters<ƒ>) => ReturnType<ƒ> {
|
|
11
|
+
const store = React.useContext(StoreContext)
|
|
12
|
+
const { socket } = React.useContext(RealtimeContext)
|
|
13
|
+
React.useEffect(
|
|
14
|
+
() => RTC.synchronizeTransactionResults(token, socket, store),
|
|
15
|
+
[token.key],
|
|
16
|
+
)
|
|
17
|
+
return AtomIO.runTransaction(token, store)
|
|
18
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RenderResult } from '@testing-library/react';
|
|
2
|
+
import * as AtomIO from 'atom.io';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as SocketIO from 'socket.io';
|
|
5
|
+
|
|
6
|
+
type TestSetupOptions = {
|
|
7
|
+
server: (tools: {
|
|
8
|
+
socket: SocketIO.Socket;
|
|
9
|
+
silo: AtomIO.Silo;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
type TestSetupOptions__SingleClient = TestSetupOptions & {
|
|
13
|
+
client: React.FC;
|
|
14
|
+
};
|
|
15
|
+
type TestSetupOptions__MultiClient<ClientNames extends string> = TestSetupOptions & {
|
|
16
|
+
clients: {
|
|
17
|
+
[K in ClientNames]: React.FC;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type RealtimeTestTools = {
|
|
21
|
+
name: string;
|
|
22
|
+
silo: AtomIO.Silo;
|
|
23
|
+
dispose: () => void;
|
|
24
|
+
};
|
|
25
|
+
type RealtimeTestClient = RealtimeTestTools & {
|
|
26
|
+
renderResult: RenderResult;
|
|
27
|
+
prettyPrint: () => void;
|
|
28
|
+
reconnect: () => void;
|
|
29
|
+
disconnect: () => void;
|
|
30
|
+
};
|
|
31
|
+
type RealtimeTestServer = RealtimeTestTools & {
|
|
32
|
+
port: number;
|
|
33
|
+
};
|
|
34
|
+
type RealtimeTestAPI = {
|
|
35
|
+
server: RealtimeTestServer;
|
|
36
|
+
teardown: () => void;
|
|
37
|
+
};
|
|
38
|
+
type RealtimeTestAPI__SingleClient = RealtimeTestAPI & {
|
|
39
|
+
client: RealtimeTestClient;
|
|
40
|
+
};
|
|
41
|
+
type RealtimeTestAPI__MultiClient<ClientNames extends string> = RealtimeTestAPI & {
|
|
42
|
+
clients: Record<ClientNames, RealtimeTestClient>;
|
|
43
|
+
};
|
|
44
|
+
declare const setupRealtimeTestServer: (options: TestSetupOptions) => RealtimeTestServer;
|
|
45
|
+
declare const setupRealtimeTestClient: (options: TestSetupOptions__SingleClient, name: string, port: number) => RealtimeTestClient;
|
|
46
|
+
declare const singleClient: (options: TestSetupOptions__SingleClient) => RealtimeTestAPI__SingleClient;
|
|
47
|
+
declare const multiClient: <ClientNames extends string>(options: TestSetupOptions__MultiClient<ClientNames>) => RealtimeTestAPI__MultiClient<ClientNames>;
|
|
48
|
+
|
|
49
|
+
export { RealtimeTestAPI, RealtimeTestAPI__MultiClient, RealtimeTestAPI__SingleClient, RealtimeTestClient, RealtimeTestServer, RealtimeTestTools, TestSetupOptions, TestSetupOptions__MultiClient, TestSetupOptions__SingleClient, multiClient, setupRealtimeTestClient, setupRealtimeTestServer, singleClient };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { RenderResult } from '@testing-library/react';
|
|
2
|
+
import * as AtomIO from 'atom.io';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as SocketIO from 'socket.io';
|
|
5
|
+
|
|
6
|
+
type TestSetupOptions = {
|
|
7
|
+
server: (tools: {
|
|
8
|
+
socket: SocketIO.Socket;
|
|
9
|
+
silo: AtomIO.Silo;
|
|
10
|
+
}) => void;
|
|
11
|
+
};
|
|
12
|
+
type TestSetupOptions__SingleClient = TestSetupOptions & {
|
|
13
|
+
client: React.FC;
|
|
14
|
+
};
|
|
15
|
+
type TestSetupOptions__MultiClient<ClientNames extends string> = TestSetupOptions & {
|
|
16
|
+
clients: {
|
|
17
|
+
[K in ClientNames]: React.FC;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type RealtimeTestTools = {
|
|
21
|
+
name: string;
|
|
22
|
+
silo: AtomIO.Silo;
|
|
23
|
+
dispose: () => void;
|
|
24
|
+
};
|
|
25
|
+
type RealtimeTestClient = RealtimeTestTools & {
|
|
26
|
+
renderResult: RenderResult;
|
|
27
|
+
prettyPrint: () => void;
|
|
28
|
+
reconnect: () => void;
|
|
29
|
+
disconnect: () => void;
|
|
30
|
+
};
|
|
31
|
+
type RealtimeTestServer = RealtimeTestTools & {
|
|
32
|
+
port: number;
|
|
33
|
+
};
|
|
34
|
+
type RealtimeTestAPI = {
|
|
35
|
+
server: RealtimeTestServer;
|
|
36
|
+
teardown: () => void;
|
|
37
|
+
};
|
|
38
|
+
type RealtimeTestAPI__SingleClient = RealtimeTestAPI & {
|
|
39
|
+
client: RealtimeTestClient;
|
|
40
|
+
};
|
|
41
|
+
type RealtimeTestAPI__MultiClient<ClientNames extends string> = RealtimeTestAPI & {
|
|
42
|
+
clients: Record<ClientNames, RealtimeTestClient>;
|
|
43
|
+
};
|
|
44
|
+
declare const setupRealtimeTestServer: (options: TestSetupOptions) => RealtimeTestServer;
|
|
45
|
+
declare const setupRealtimeTestClient: (options: TestSetupOptions__SingleClient, name: string, port: number) => RealtimeTestClient;
|
|
46
|
+
declare const singleClient: (options: TestSetupOptions__SingleClient) => RealtimeTestAPI__SingleClient;
|
|
47
|
+
declare const multiClient: <ClientNames extends string>(options: TestSetupOptions__MultiClient<ClientNames>) => RealtimeTestAPI__MultiClient<ClientNames>;
|
|
48
|
+
|
|
49
|
+
export { RealtimeTestAPI, RealtimeTestAPI__MultiClient, RealtimeTestAPI__SingleClient, RealtimeTestClient, RealtimeTestServer, RealtimeTestTools, TestSetupOptions, TestSetupOptions__MultiClient, TestSetupOptions__SingleClient, multiClient, setupRealtimeTestClient, setupRealtimeTestServer, singleClient };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var http = require('http');
|
|
4
|
+
var react = require('@testing-library/react');
|
|
5
|
+
var AtomIO = require('atom.io');
|
|
6
|
+
var Internal = require('atom.io/internal');
|
|
7
|
+
var AR = require('atom.io/react');
|
|
8
|
+
var RTC = require('atom.io/realtime-react');
|
|
9
|
+
var Happy = require('happy-dom');
|
|
10
|
+
var SocketIO = require('socket.io');
|
|
11
|
+
var socket_ioClient = require('socket.io-client');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n.default = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var http__namespace = /*#__PURE__*/_interopNamespace(http);
|
|
33
|
+
var AtomIO__namespace = /*#__PURE__*/_interopNamespace(AtomIO);
|
|
34
|
+
var Internal__namespace = /*#__PURE__*/_interopNamespace(Internal);
|
|
35
|
+
var AR__namespace = /*#__PURE__*/_interopNamespace(AR);
|
|
36
|
+
var RTC__namespace = /*#__PURE__*/_interopNamespace(RTC);
|
|
37
|
+
var Happy__namespace = /*#__PURE__*/_interopNamespace(Happy);
|
|
38
|
+
var SocketIO__namespace = /*#__PURE__*/_interopNamespace(SocketIO);
|
|
39
|
+
|
|
40
|
+
var __defProp = Object.defineProperty;
|
|
41
|
+
var __defProps = Object.defineProperties;
|
|
42
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
43
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
44
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
45
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
46
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
47
|
+
var __spreadValues = (a, b) => {
|
|
48
|
+
for (var prop in b || (b = {}))
|
|
49
|
+
if (__hasOwnProp.call(b, prop))
|
|
50
|
+
__defNormalProp(a, prop, b[prop]);
|
|
51
|
+
if (__getOwnPropSymbols)
|
|
52
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
53
|
+
if (__propIsEnum.call(b, prop))
|
|
54
|
+
__defNormalProp(a, prop, b[prop]);
|
|
55
|
+
}
|
|
56
|
+
return a;
|
|
57
|
+
};
|
|
58
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
59
|
+
|
|
60
|
+
// ../../anvl/src/object/entries.ts
|
|
61
|
+
var recordToEntries = (obj) => Object.entries(obj);
|
|
62
|
+
var setupRealtimeTestServer = (options) => {
|
|
63
|
+
const httpServer = http__namespace.createServer((_, res) => res.end(`Hello World!`));
|
|
64
|
+
const address = httpServer.listen().address();
|
|
65
|
+
const port = typeof address === `string` ? 80 : address === null ? null : address.port;
|
|
66
|
+
if (port === null)
|
|
67
|
+
throw new Error(`Could not determine port for test server`);
|
|
68
|
+
const server = new SocketIO__namespace.Server(httpServer);
|
|
69
|
+
const silo = new AtomIO__namespace.Silo(`SERVER`, Internal__namespace.IMPLICIT.STORE);
|
|
70
|
+
server.on(`connection`, (socket) => {
|
|
71
|
+
options.server({ socket, silo });
|
|
72
|
+
});
|
|
73
|
+
const dispose = () => {
|
|
74
|
+
server.close();
|
|
75
|
+
Internal__namespace.clearStore(silo.store);
|
|
76
|
+
};
|
|
77
|
+
return {
|
|
78
|
+
name: `SERVER`,
|
|
79
|
+
silo,
|
|
80
|
+
dispose,
|
|
81
|
+
port
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
var setupRealtimeTestClient = (options, name, port) => {
|
|
85
|
+
const socket = socket_ioClient.io(`http://localhost:${port}/`);
|
|
86
|
+
const silo = new AtomIO__namespace.Silo(name, Internal__namespace.IMPLICIT.STORE);
|
|
87
|
+
const { document } = new Happy__namespace.Window();
|
|
88
|
+
document.body.innerHTML = `<div id="app"></div>`;
|
|
89
|
+
const renderResult = react.render(
|
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(AR__namespace.StoreProvider, { store: silo.store, children: /* @__PURE__ */ jsxRuntime.jsx(RTC__namespace.RealtimeProvider, { socket, children: /* @__PURE__ */ jsxRuntime.jsx(options.client, {}) }) }),
|
|
91
|
+
{
|
|
92
|
+
container: document.querySelector(`#app`)
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
|
+
const prettyPrint = () => console.log(react.prettyDOM(renderResult.container));
|
|
96
|
+
const disconnect = () => socket.disconnect();
|
|
97
|
+
const reconnect = () => socket.connect();
|
|
98
|
+
const dispose = () => {
|
|
99
|
+
socket.disconnect();
|
|
100
|
+
Internal__namespace.clearStore(silo.store);
|
|
101
|
+
};
|
|
102
|
+
return {
|
|
103
|
+
name,
|
|
104
|
+
silo,
|
|
105
|
+
renderResult,
|
|
106
|
+
prettyPrint,
|
|
107
|
+
disconnect,
|
|
108
|
+
reconnect,
|
|
109
|
+
dispose
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
var singleClient = (options) => {
|
|
113
|
+
const server = setupRealtimeTestServer(options);
|
|
114
|
+
const client = setupRealtimeTestClient(options, `CLIENT`, server.port);
|
|
115
|
+
return {
|
|
116
|
+
client,
|
|
117
|
+
server,
|
|
118
|
+
teardown: () => {
|
|
119
|
+
client.dispose();
|
|
120
|
+
server.dispose();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
var multiClient = (options) => {
|
|
125
|
+
const server = setupRealtimeTestServer(options);
|
|
126
|
+
const clients = recordToEntries(options.clients).reduce(
|
|
127
|
+
(clients2, [name, client]) => __spreadProps(__spreadValues({}, clients2), {
|
|
128
|
+
[name]: setupRealtimeTestClient(__spreadProps(__spreadValues({}, options), { client }), name, server.port)
|
|
129
|
+
}),
|
|
130
|
+
{}
|
|
131
|
+
);
|
|
132
|
+
return {
|
|
133
|
+
clients,
|
|
134
|
+
server,
|
|
135
|
+
teardown: () => {
|
|
136
|
+
recordToEntries(clients).forEach(([, client]) => client.dispose());
|
|
137
|
+
server.dispose();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
exports.multiClient = multiClient;
|
|
143
|
+
exports.setupRealtimeTestClient = setupRealtimeTestClient;
|
|
144
|
+
exports.setupRealtimeTestServer = setupRealtimeTestServer;
|
|
145
|
+
exports.singleClient = singleClient;
|
|
146
|
+
//# sourceMappingURL=out.js.map
|
|
147
|
+
//# sourceMappingURL=index.js.map
|