Hi everyone,
We've recently merged a breaking change into batman/master and wanted to give you all the info you need to upgrade when the time comes!
The change affects the Batman.Set
and Batman.SimpleSet
constructors. Previously, you would create Sets by passing the contents as multiple arguments. From now on, you must create Sets by passing an array of contents as a single argument. Here's an example:
someArray = [1, 2, 3]
# OLD
someSet = new Batman.Set(1, 2, 3)
someSet = new Batman.Set(someArray...)
# NEW
someSet = new Batman.Set([1, 2, 3])
someSet = new Batman.Set(someArray)
We found this to be the more intuitive approach, while also being much more performant by avoiding the stack expansion.
Besides this change to the constructor, we've also added Set::addArray
and Set::removeArray
.
This update will be released in batman.js v0.17.0.
Thanks!
# A Batman.Set whose members are arrays
# old
new Batman.Set([1, 2])
# new
new Batman.Set([[1, 2]])
What if your set is intended to be initialized with elements that are arrays?
--
Dan Ott
> Hi everyone,
>
> We've recently merged a breaking change into batman/master and wanted to give you all the info you need to upgrade when the time comes!
>
> The change affects the Batman.Set and Batman.SimpleSet constructors. Previously, you would create Sets by passing the contents as multiple arguments. From now on, you must create Sets by passing an array of contents as a single argument. Here's an example:
>
>
>
> someArray = [1, 2, 3]
>
> # OLD
> someSet = new Batman.Set(1, 2, 3)
> someSet = new Batman.Set(someArray...)
>
> # NEW
> someSet = new Batman.Set([1, 2, 3])
> someSet = new Batman.Set(someArray)
>
> We found this to be the more intuitive approach, while also being much more performant by avoiding the stack expansion.
>
> Besides this change to the constructor, we've also added Set::addArray and Set::removeArray.
>
> This update will be released in batman.js v0.17.0.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "batman.js" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+unsubscribe@googlegroups.com.