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.37k stars 194 forks source link

Cannot make setInterval return object immutable in Node #176

Open SgtRock91 opened 7 years ago

SgtRock91 commented 7 years ago

On a browser, setInterval will return an integer which can be made immutable. On Node, setInterval returns an object. When we attempt to make this object immutable using seamless-immutable a 'Function.prototype.toString is not generic' exception is thrown. We can replicate the error with the following code snippet on Node:

const id = setInterval(()=>{console.log('Hello World')}, 100);
const immutableObject = Immutable(id);

Has anyone else experienced this issue or know of a work-around?