Echo JS 0.11.0


amitport comments

amitport 57 days ago. link 1 point

BTW this user/bot posted 38 spam messages.
amitport 70 days ago. link 1 point
[spam] should add a script that just removes any post with bitcoin in the title
amitport 140 days ago. link 1 point
there are actually a few points that are not so clear in the changelog. It's a rehash but it has some extra value IMO
amitport 189 days ago. link 1 point
I'm pretty sure he understands the difference... he's just saying that if it doesn't make the object immutable then it is not that useful.

(I disagree with him. I think minimal variables reassigning makes code easier to understand and 'const' helps to encourage that)
amitport 190 days ago. link 5 points
appreciate the effort, but this is really not that useful IMHO.

1 - setInterval is very well known and there should be a real compelling reason to use a custom wrapper api.

2 - the library usage has side-effects... if two dependencies/files use this without coping the instance- things will get unpredictable

3 - you're making SetInterval instances via object copy (prototype design pattern)- the created cloned instance is a new variable, which is what you set out to avoid.
3* - if you prefer objects over the interval return variable, it would have been simpler to use classes (though I still prefer the base API):

class Interval {
  constructor(fn, interval) {
    this.timer = setInterval(fn, interval);
  clear() {clearInterval(this.timer);}