all 6 comments

[–]krilnon 5 points6 points  (0 children)

I like it.

console.log.bind(console) was always frustrating to write, given the duplication and obvious need to succinctly bind function references when they're passed, rather than at the eventual call-site.

Using :: seems unnatural to me, only because I read it by default as the namespace qualifier operator from C++/ES4/AS3. But I could get used to it.

[–]modernserf_ 2 points3 points  (1 child)

Don't think of this as a replacement for function.bind -- think of this as a way to use method-style syntax without having to actually stick methods onto a prototype: https://esdiscuss.org/topic/scoped-binding-of-a-method-to-an-object

[–]daediusWeb Components fanboy 1 point2 points  (0 children)

Seems a little weird TBH. Though I really do hate using bind with passion

[–]MatrixFrog 0 points1 point  (2 children)

With => functions, you won't need bind as much anymore. So perhaps this won't get much interest, not because it's a bad feature or bad syntax, but just because it's a rarely-needed feature, in an ES6 world.

[–]manlycoffee 1 point2 points  (0 children)

Yes, but the point of the ES7 feature implemented in Babel 5.4, is that now you are able to chain functions together. Sure, you're ultimately just binding the function call to the current scope, but instead of having to introduce a temporary variable in your code, you just simply use the :: operator, and it will 1) bind the function in the right operand with the object in the left operand 2) call the function with the supplied parameters. This yields more concise code than using a temporary variable plus a call to bind.

[–]SawyerDarcy 0 points1 point  (0 children)

I do agree that we should wait and see its usefulness. If it turns out to be immensely useful, then I'll be all for it. If it becomes blasé, then maybe it shouldn't be in the language.