@voltro/web 0.1.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/CHANGELOG.md +52 -0
- package/LICENSE +57 -0
- package/README.md +26 -0
- package/SECURITY.md +56 -0
- package/THIRD-PARTY-NOTICES.md +347 -0
- package/dist/defaultFallbacks-Bg_X-9Wv.js +541 -0
- package/dist/frameworkBoot-DBOFujAI.js +596 -0
- package/dist/frameworkBoot.d.ts +64 -0
- package/dist/frameworkBoot.js +2 -0
- package/dist/hooks.d.ts +28 -0
- package/dist/hooks.js +14 -0
- package/dist/index.d.ts +1077 -0
- package/dist/index.js +141 -0
- package/dist/mount-BuFzlw1e.js +74 -0
- package/dist/mount.d.ts +70 -0
- package/dist/mount.js +2 -0
- package/dist/serverContext-D5-Dmh8d.js +741 -0
- package/dist/ssr.d.ts +322 -0
- package/dist/ssr.js +76 -0
- package/package.json +68 -0
package/dist/hooks.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "react";
|
|
2
|
+
//#region src/hooks.ts
|
|
3
|
+
var n = e(null), r = (e) => {
|
|
4
|
+
let r = t(n);
|
|
5
|
+
if (!r) throw Error("useAppClient: no clients in context. Make sure your app is mounted via @voltro/web mount().");
|
|
6
|
+
let i = r.get(e);
|
|
7
|
+
if (!i) {
|
|
8
|
+
let t = Array.from(r.keys()).join(", ") || "(none)";
|
|
9
|
+
throw Error(`useAppClient: no api named ${JSON.stringify(e)}. Known apis: ${t}`);
|
|
10
|
+
}
|
|
11
|
+
return i;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { n as AppClientsContext, r as useAppClient };
|