react-usespinner 1.0.11 → 1.0.12

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.
@@ -22,12 +22,11 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
23
  var jsx_runtime_1 = require("react/jsx-runtime");
24
24
  var react_1 = require("react");
25
- var react_2 = require("react");
26
25
  var useSpinner = function (globalOptions) {
27
26
  // store a list of actions
28
- var _a = (0, react_2.useState)([]), actions = _a[0], setActions = _a[1];
27
+ var _a = (0, react_1.useState)([]), actions = _a[0], setActions = _a[1];
29
28
  // set a timer that every second checks if any actions can be closed
30
- (0, react_2.useEffect)(function () {
29
+ (0, react_1.useEffect)(function () {
31
30
  var timer = setTimeout(function () {
32
31
  if (actions) {
33
32
  setActions(function (prev) { return prev.filter(function (item) { return item.endtime > Date.now(); }); });
@@ -54,7 +53,7 @@ var useSpinner = function (globalOptions) {
54
53
  var busy = function () {
55
54
  return actions && actions.length > 0;
56
55
  };
57
- var fetch = (0, react_1.useCallback)(function () {
56
+ var fetch = function () {
58
57
  var params = [];
59
58
  for (var _i = 0; _i < arguments.length; _i++) {
60
59
  params[_i] = arguments[_i];
@@ -81,7 +80,7 @@ var useSpinner = function (globalOptions) {
81
80
  end(id);
82
81
  });
83
82
  });
84
- }, [end, start]);
83
+ };
85
84
  // JSX component used to wrap spinner of choice
86
85
  var SpinnerContainer = function (_a) {
87
86
  var spinner = _a.spinner, children = _a.children;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-usespinner",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "description": "Track actions in progress to know if a spinner should be display. Actions expire within 10 seconds if not expired in code",
5
5
  "private": false,
6
6
  "license": "MIT",