@basictech/react 0.2.0-beta.1 → 0.2.0-beta.2

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @basictech/react@1.1.0 build
3
+ > @basictech/react@0.2.0-beta.1 build
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: src/index.ts
@@ -11,13 +11,13 @@
11
11
  CLI Cleaning output folder
12
12
  CJS Build start
13
13
  ESM Build start
14
- CJS dist/index.js 8.50 KB
15
- CJS dist/index.js.map 15.26 KB
16
- CJS ⚡️ Build success in 21ms
17
- ESM dist/index.mjs 7.26 KB
18
- ESM dist/index.mjs.map 15.11 KB
19
- ESM ⚡️ Build success in 21ms
14
+ ESM dist/index.mjs 319.29 KB
15
+ ESM dist/index.mjs.map 681.95 KB
16
+ ESM ⚡️ Build success in 98ms
17
+ CJS dist/index.js 320.14 KB
18
+ CJS dist/index.js.map 681.99 KB
19
+ CJS ⚡️ Build success in 100ms
20
20
  DTS Build start
21
- DTS ⚡️ Build success in 1165ms
22
- DTS dist/index.d.ts 689.00 B
23
- DTS dist/index.d.mts 689.00 B
21
+ DTS ⚡️ Build success in 1093ms
22
+ DTS dist/index.d.ts 975.00 B
23
+ DTS dist/index.d.mts 975.00 B
package/changelog.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # 1.3.4
2
2
 
3
+ ## 0.2.0-beta.2
4
+
5
+ ### Minor Changes
6
+
7
+ - rebuild tsup
8
+
3
9
  ## 0.2.0-beta.1
4
10
 
5
11
  ### Minor Changes
package/dist/index.js CHANGED
@@ -5950,7 +5950,7 @@ var src_exports = {};
5950
5950
  __export(src_exports, {
5951
5951
  BasicProvider: () => BasicProvider,
5952
5952
  useBasic: () => useBasic,
5953
- useQuery: () => useLiveQuery
5953
+ useQuery: () => import_dexie_react_hooks.useLiveQuery
5954
5954
  });
5955
5955
  module.exports = __toCommonJS(src_exports);
5956
5956
 
@@ -8264,85 +8264,8 @@ function useBasic() {
8264
8264
  return (0, import_react.useContext)(BasicContext);
8265
8265
  }
8266
8266
 
8267
- // ../../node_modules/dexie-react-hooks/dist/dexie-react-hooks.mjs
8268
- var import_react2 = __toESM(require("react"), 1);
8269
- function useObservable(observableFactory, arg2, arg3) {
8270
- var deps;
8271
- var defaultResult;
8272
- if (typeof observableFactory === "function") {
8273
- deps = arg2 || [];
8274
- defaultResult = arg3;
8275
- } else {
8276
- deps = [];
8277
- defaultResult = arg2;
8278
- }
8279
- var monitor = import_react2.default.useRef({
8280
- hasResult: false,
8281
- result: defaultResult,
8282
- error: null
8283
- });
8284
- var _a = import_react2.default.useReducer(function(x) {
8285
- return x + 1;
8286
- }, 0);
8287
- _a[0];
8288
- var triggerUpdate = _a[1];
8289
- var observable = import_react2.default.useMemo(function() {
8290
- var observable2 = typeof observableFactory === "function" ? observableFactory() : observableFactory;
8291
- if (!observable2 || typeof observable2.subscribe !== "function") {
8292
- if (observableFactory === observable2) {
8293
- throw new TypeError("Given argument to useObservable() was neither a valid observable nor a function.");
8294
- } else {
8295
- throw new TypeError("Observable factory given to useObservable() did not return a valid observable.");
8296
- }
8297
- }
8298
- if (!monitor.current.hasResult && typeof window !== "undefined") {
8299
- if (typeof observable2.hasValue !== "function" || observable2.hasValue()) {
8300
- if (typeof observable2.getValue === "function") {
8301
- monitor.current.result = observable2.getValue();
8302
- monitor.current.hasResult = true;
8303
- } else {
8304
- var subscription = observable2.subscribe(function(val) {
8305
- monitor.current.result = val;
8306
- monitor.current.hasResult = true;
8307
- });
8308
- if (typeof subscription === "function") {
8309
- subscription();
8310
- } else {
8311
- subscription.unsubscribe();
8312
- }
8313
- }
8314
- }
8315
- }
8316
- return observable2;
8317
- }, deps);
8318
- import_react2.default.useDebugValue(monitor.current.result);
8319
- import_react2.default.useEffect(function() {
8320
- var subscription = observable.subscribe(function(val) {
8321
- var current = monitor.current;
8322
- if (current.error !== null || current.result !== val) {
8323
- current.error = null;
8324
- current.result = val;
8325
- current.hasResult = true;
8326
- triggerUpdate();
8327
- }
8328
- }, function(err) {
8329
- var current = monitor.current;
8330
- if (current.error !== err) {
8331
- current.error = err;
8332
- triggerUpdate();
8333
- }
8334
- });
8335
- return typeof subscription === "function" ? subscription : subscription.unsubscribe.bind(subscription);
8336
- }, deps);
8337
- if (monitor.current.error)
8338
- throw monitor.current.error;
8339
- return monitor.current.result;
8340
- }
8341
- function useLiveQuery(querier, deps, defaultResult) {
8342
- return useObservable(function() {
8343
- return liveQuery(querier);
8344
- }, deps || [], defaultResult);
8345
- }
8267
+ // src/index.ts
8268
+ var import_dexie_react_hooks = require("dexie-react-hooks");
8346
8269
  // Annotate the CommonJS export names for ESM import in node:
8347
8270
  0 && (module.exports = {
8348
8271
  BasicProvider,