@oscarpalmer/atoms 0.41.2 → 0.41.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.
package/dist/js/index.js CHANGED
@@ -793,13 +793,10 @@ var work = function(type, timer2, state, options) {
793
793
  }
794
794
  state.active = true;
795
795
  const isRepeated2 = count > 0;
796
- let index = 0;
797
- let total = count * (interval > 0 ? interval : 1);
798
- if (total < 16.66667) {
799
- total = 16.66667;
800
- }
796
+ const total = count === Number.POSITIVE_INFINITY ? timeout : count * (interval > 0 ? interval : 17);
801
797
  let current;
802
798
  let start;
799
+ let index = 0;
803
800
  function finish(finished, error) {
804
801
  state.active = false;
805
802
  state.frame = undefined;
package/dist/js/timer.js CHANGED
@@ -111,13 +111,10 @@ var work = function(type, timer2, state, options) {
111
111
  }
112
112
  state.active = true;
113
113
  const isRepeated2 = count > 0;
114
- let index = 0;
115
- let total = count * (interval > 0 ? interval : 1);
116
- if (total < 16.66667) {
117
- total = 16.66667;
118
- }
114
+ const total = count === Number.POSITIVE_INFINITY ? timeout : count * (interval > 0 ? interval : 17);
119
115
  let current;
120
116
  let start;
117
+ let index = 0;
121
118
  function finish(finished, error) {
122
119
  state.active = false;
123
120
  state.frame = undefined;
package/dist/js/timer.mjs CHANGED
@@ -111,13 +111,10 @@ var work = function(type, timer2, state, options) {
111
111
  }
112
112
  state.active = true;
113
113
  const isRepeated2 = count > 0;
114
- let index = 0;
115
- let total = count * (interval > 0 ? interval : 1);
116
- if (total < 16.66667) {
117
- total = 16.66667;
118
- }
114
+ const total = count === Number.POSITIVE_INFINITY ? timeout : count * (interval > 0 ? interval : 17);
119
115
  let current;
120
116
  let start;
117
+ let index = 0;
121
118
  function finish(finished, error) {
122
119
  state.active = false;
123
120
  state.frame = undefined;
package/package.json CHANGED
@@ -130,5 +130,5 @@
130
130
  },
131
131
  "type": "module",
132
132
  "types": "./types/index.d.ts",
133
- "version": "0.41.2"
133
+ "version": "0.41.4"
134
134
  }
package/src/js/timer.ts CHANGED
@@ -56,7 +56,7 @@ type State = {
56
56
  /**
57
57
  * A timer that can be started, stopped, and restarted as neeeded
58
58
  */
59
- type Timer = {
59
+ export type Timer = {
60
60
  /**
61
61
  * Is the timer running?
62
62
  */
@@ -79,7 +79,7 @@ type TimerOptions = {} & RepeatOptions;
79
79
 
80
80
  type WaitOptions = {} & BaseOptions & OptionsWithError;
81
81
 
82
- type When = {
82
+ export type When = {
83
83
  /**
84
84
  * Stops the timer
85
85
  */
@@ -311,16 +311,16 @@ function work(
311
311
 
312
312
  const isRepeated = count > 0;
313
313
 
314
- let index = 0;
315
- let total = count * (interval > 0 ? interval : 1);
316
-
317
- if (total < 16.66667) {
318
- total = 16.66667;
319
- }
314
+ const total =
315
+ count === Number.POSITIVE_INFINITY
316
+ ? timeout
317
+ : count * (interval > 0 ? interval : 17);
320
318
 
321
319
  let current: DOMHighResTimeStamp | null;
322
320
  let start: DOMHighResTimeStamp | null;
323
321
 
322
+ let index = 0;
323
+
324
324
  function finish(finished: boolean, error: boolean) {
325
325
  state.active = false;
326
326
  state.frame = undefined;
package/types/timer.d.ts CHANGED
@@ -39,7 +39,7 @@ type RepeatOptions = {
39
39
  /**
40
40
  * A timer that can be started, stopped, and restarted as neeeded
41
41
  */
42
- type Timer = {
42
+ export type Timer = {
43
43
  /**
44
44
  * Is the timer running?
45
45
  */
@@ -58,7 +58,7 @@ type Timer = {
58
58
  stop(): Timer;
59
59
  };
60
60
  type WaitOptions = {} & BaseOptions & OptionsWithError;
61
- type When = {
61
+ export type When = {
62
62
  /**
63
63
  * Stops the timer
64
64
  */