connected: function() { return setTimeout((function(_this) { return function() { return _this.followVisibleprojects(); }; })(this), 1000); },
The Practical Guide to Using ActionCable
Rob Race

Rob Race Could you explain this function? I’m a js noob and confused by the closure within setTimeout. Is it just to bind this properly?

Within that closure, why can’t you just return _this.followVisibleProjects()without thereturn function() {...}

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.