@livequery/react 2.0.22 → 2.0.24

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.
@@ -8,7 +8,7 @@ export function mergeTransporterHooks(...hooks) {
8
8
  const LivequeryContext = createContext({});
9
9
  export const useLivequeryContext = () => {
10
10
  const ctx = useContext(LivequeryContext);
11
- if (!ctx.transporter)
11
+ if (!ctx.transporter && typeof window != 'undefined')
12
12
  throw 'MISSING_LIVEQUERY_TRANSPORTER';
13
13
  return {
14
14
  transporter: ctx.transporter
@@ -34,8 +34,10 @@ export const useCollectionData = (ref, collection_options = {}) => {
34
34
  };
35
35
  }, [client, set_$, collection_options.lazy, set_state]);
36
36
  const empty = !!(!$.loading && $.items.length == 0);
37
+ const loading = $.loading || (collection_options.lazy ? 'both' : false);
37
38
  const result = {
38
39
  ...$,
40
+ loading,
39
41
  state,
40
42
  empty,
41
43
  filters: $.options,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/livequery/react"
5
5
  },
6
6
  "type": "module",
7
- "version": "2.0.22",
7
+ "version": "2.0.24",
8
8
  "description": "",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",