rtfeldman / seamless-immutable

Immutable data structures for JavaScript which are backwards-compatible with normal JS Arrays and Objects.
BSD 3-Clause "New" or "Revised" License
5.36k stars 194 forks source link

How do I get rid of the immutable methods on an array? #185

Closed peterpme closed 7 years ago

peterpme commented 7 years ago

Hello @rtfeldman, your library is awesome! Thanks for making my life easier!

I have one issue I can't seem to figure out, (maybe it's late) but how do I get rid of the immutable properties from an array?

I'd like to make an HTTP request but the rest of the information is being sent down as well!

Thank you :)

theogravity commented 7 years ago

Have you tried using the static version of the library?

Eg

const Immutable = require('seamless-immutable').static

const data = Immutable.from({ myData: []})

let newData = Immutable.set(data, 'myData', ['blah'])

The static version of the API should not have methods attached AFAIK

peterpme commented 7 years ago

Hey @theogravity thanks for getting back to me! This is great!