@dhis2/app-service-offline 3.17.0-beta.2 → 3.17.0-beta.4

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.
@@ -82,19 +82,19 @@ function useCacheableSection(id) {
82
82
  (0, _reactDom.flushSync)(() => {
83
83
  onRecordingStarted();
84
84
  });
85
- onStarted && onStarted();
85
+ onStarted === null || onStarted === void 0 || onStarted();
86
86
  },
87
87
  onCompleted: () => {
88
88
  (0, _reactDom.flushSync)(() => {
89
89
  onRecordingCompleted();
90
90
  });
91
- onCompleted && onCompleted();
91
+ onCompleted === null || onCompleted === void 0 || onCompleted();
92
92
  },
93
93
  onError: error => {
94
94
  (0, _reactDom.flushSync)(() => {
95
95
  onRecordingError(error);
96
96
  });
97
- onError && onError(error);
97
+ onError === null || onError === void 0 || onError(error);
98
98
  }
99
99
  }).then(() => setRecordingState(recordingStates.pending));
100
100
  }, [id, offlineInterface, onRecordingCompleted, onRecordingError, onRecordingStarted, setRecordingState]);
@@ -228,7 +228,7 @@ describe('interval behavior', () => {
228
228
  }
229
229
 
230
230
  // expect ping mock not to have been called
231
- expect(mockPing).not.toHaveBeenCalled;
231
+ expect(mockPing).not.toHaveBeenCalled();
232
232
  });
233
233
  test('if the status is the same, the ping delay is reset to the current', () => {
234
234
  const setTimeoutSpy = jest.spyOn(window, 'setTimeout');
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.resetRenderCounts = exports.RenderCounter = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+ /* eslint-disable react-hooks/immutability */
10
+
9
11
  const RenderCounter = ({
10
12
  id,
11
13
  countsObj
@@ -73,19 +73,19 @@ export function useCacheableSection(id) {
73
73
  flushSync(() => {
74
74
  onRecordingStarted();
75
75
  });
76
- onStarted && onStarted();
76
+ onStarted === null || onStarted === void 0 || onStarted();
77
77
  },
78
78
  onCompleted: () => {
79
79
  flushSync(() => {
80
80
  onRecordingCompleted();
81
81
  });
82
- onCompleted && onCompleted();
82
+ onCompleted === null || onCompleted === void 0 || onCompleted();
83
83
  },
84
84
  onError: error => {
85
85
  flushSync(() => {
86
86
  onRecordingError(error);
87
87
  });
88
- onError && onError(error);
88
+ onError === null || onError === void 0 || onError(error);
89
89
  }
90
90
  }).then(() => setRecordingState(recordingStates.pending));
91
91
  }, [id, offlineInterface, onRecordingCompleted, onRecordingError, onRecordingStarted, setRecordingState]);
@@ -225,7 +225,7 @@ describe('interval behavior', () => {
225
225
  }
226
226
 
227
227
  // expect ping mock not to have been called
228
- expect(mockPing).not.toHaveBeenCalled;
228
+ expect(mockPing).not.toHaveBeenCalled();
229
229
  });
230
230
  test('if the status is the same, the ping delay is reset to the current', () => {
231
231
  const setTimeoutSpy = jest.spyOn(window, 'setTimeout');
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react-hooks/immutability */
1
2
  import React from 'react';
2
3
  export const RenderCounter = ({
3
4
  id,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dhis2/app-service-offline",
3
3
  "description": "A runtime service for online/offline detection and offline caching",
4
- "version": "3.17.0-beta.2",
4
+ "version": "3.17.0-beta.4",
5
5
  "main": "./build/cjs/index.js",
6
6
  "module": "./build/es/index.js",
7
7
  "types": "./build/types/index.d.ts",
@@ -34,7 +34,7 @@
34
34
  "coverage": "yarn test --coverage"
35
35
  },
36
36
  "peerDependencies": {
37
- "@dhis2/app-service-config": "3.17.0-beta.2",
37
+ "@dhis2/app-service-config": "3.17.0-beta.4",
38
38
  "react": "^16.8.6 || ^18",
39
39
  "react-dom": "^16.8.6 || ^18"
40
40
  },