eddev 0.2.4 → 0.2.7

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.
@@ -68,7 +68,6 @@ function BrowserRouter(props) {
68
68
  setIsLoading(true);
69
69
  }
70
70
  (0, remoteProps_1.fetchProps)(pending.url).then(function (data) {
71
- console.log("FETCHED", data);
72
71
  var view = views_1.default[data.view];
73
72
  var nextUrl = data.canonical || pending.url;
74
73
  var finish = function () {
@@ -6,7 +6,10 @@ declare type GraphQLError = {
6
6
  declare type CreateUseQueryOptions = {
7
7
  name: string;
8
8
  };
9
- declare type QueryOptions = {};
9
+ declare type QueryOptions = {
10
+ revalidateIfStale?: boolean;
11
+ revalidateOnFocus?: boolean;
12
+ };
10
13
  declare type MaybeVars = {
11
14
  [key: string]: any;
12
15
  } | undefined;
@@ -83,9 +83,11 @@ var fetcherGET = function (name, params) { return __awaiter(void 0, void 0, void
83
83
  }); };
84
84
  function createUseQuery(init) {
85
85
  var hook = function (vars, opts) {
86
- var _a = (0, swr_1.default)([init.name, JSON.stringify(vars)], fetcherGET, {
87
- revalidateIfStale: false,
88
- }), payload = _a.data, isValidating = _a.isValidating, error = _a.error, mutate = _a.mutate;
86
+ var _a, _b;
87
+ var _c = (0, swr_1.default)([init.name, JSON.stringify(vars)], fetcherGET, {
88
+ revalidateIfStale: (_a = opts === null || opts === void 0 ? void 0 : opts.revalidateIfStale) !== null && _a !== void 0 ? _a : false,
89
+ revalidateOnFocus: (_b = opts === null || opts === void 0 ? void 0 : opts.revalidateOnFocus) !== null && _b !== void 0 ? _b : false,
90
+ }), payload = _c.data, isValidating = _c.isValidating, error = _c.error, mutate = _c.mutate;
89
91
  return {
90
92
  loading: isValidating && !payload,
91
93
  data: payload === null || payload === void 0 ? void 0 : payload.data,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "0.2.4",
3
+ "version": "0.2.7",
4
4
  "main": "./index.js",
5
5
  "license": "MIT",
6
6
  "bin": {
@@ -21,6 +21,7 @@
21
21
  "@components/*": ["components/*"],
22
22
  "@views/*": ["views/*"],
23
23
  "@hooks/*": ["hooks/*"],
24
+ "@utils/*": ["utils/*"],
24
25
  "@queries/*": ["hooks/queries/*"],
25
26
  "@theme": ["theme.css.tsx"],
26
27
  "@wordpress/components": ["null.ts"],