how do I replace Array.push after the extension me...
# javascript
b
how do I replace Array.push after the extension method was removed?
1
a
Is it
Array.push
from kotlin-wrappers?
b
yes
a
@turansky ^^
b
I mean I could just add it back on my own, but I'm wondering if it was removed entirely or just moved somewhere else
t
It wasn't "kotlinish". For now I think we should add 2 extensions instead: 1.
add
2.
addAll
like for other collections. Do you have multiple use cases for mutable arrays?
b
it's mainly js interop; one thing that came up quite often was mutating a state array on a controller/component
like: this.notes.push({...}) which sorta needed to become this.notes = this.notes + {...}
all in all what I've realized so far is that working with js primitives is super painful and I need functions that convert from and to js values
like turning js objects and arrays into kotlin data classes and lists
t
Array
with
add
and
addAll
- JS specific. We can add it when first step of this issue will be solved. You can add them locally for now and create issue for later communication.
b
yeah, I read through that ticket and did not fully understand it