Skip to content

Bug when threshold is set as an array #66

@cadilhac

Description

@cadilhac

I use your library like this:

ioa.observe(self.value, {
		root: self.value.parentNode,
		threshold: [0, 1]
	})

Your areOptionsSame function does not succeed comparing 2 arrays (threshold) that have the same values (index.ts, line 372).

this.areOptionsSame(a[key], b[key])

returns false when comparing [0,1] and [0,1]

This happens on line 364:

else if (type1 !== '[object Object]' && type2 !== '[object Object]') {
      return a === b;
}

because [0,1] === [0,1] returns false.

The net result is that my callbacks are never called.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions