Skip to content

Commit fd4c5ac

Browse files
committed
Revert "refactor sequence instantiation"
Regressions, grrrr....
1 parent 3ef7ef9 commit fd4c5ac

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/instance/functions/sequence.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,17 @@ export default function sequence(element, pristine = this.pristine) {
6565

6666
export function Sequence(interval) {
6767
const i = Math.abs(interval)
68-
if (i === 0) {
69-
return null
70-
}
71-
this.id = nextUniqueId()
72-
this.interval = Math.max(i, 16)
73-
this.members = []
74-
this.models = {}
75-
this.blocked = {
76-
head: false,
77-
foot: false
68+
if (typeof i === 'number' && !isNaN(i)) {
69+
this.id = nextUniqueId()
70+
this.interval = Math.max(i, 16)
71+
this.members = []
72+
this.models = {}
73+
this.blocked = {
74+
head: false,
75+
foot: false
76+
}
77+
} else {
78+
throw new RangeError('Invalid sequence interval.')
7879
}
7980
}
8081

src/instance/methods/reveal.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,14 @@ import nextUniqueId from '../../utils/next-unique-id'
1616

1717
export default function reveal(target, options = {}, syncing = false) {
1818
const containerBuffer = []
19-
const sequence = new Sequence(options.interval || defaults.interval)
19+
let sequence
20+
let interval = options.interval || defaults.interval
2021

2122
try {
23+
if (interval) {
24+
sequence = new Sequence(interval)
25+
}
26+
2227
const nodes = tealight(target)
2328
if (!nodes.length) {
2429
throw new Error('Invalid reveal target.')

0 commit comments

Comments
 (0)