News for hackers. Stuff that matters.
Re:React v0.13 released by Touche on Tuesday March 10, 2015 @08:26PM (#9181763)
Can you explain? It's sugar for this very common pattern:

    function Bar() {
      Foo.call(this);
    }

    Bar.prototype = Object.create(Foo.prototype);
    Bar.prototype.constructor = Bar;

    Foo.prototype.thing = function() { ....

What other "approach" to prototypical inheritance is there in JavaScript? The module pattern doesn't use prototypes.
Re:React v0.13 released by jbergens on Wednesday March 11, 2015 @03:13AM (#9182958)
This blog post and presentation discusses this in more detail. http://ericleads.com/2013/02/fluent-javascript-three-differe...
Re:React v0.13 released by backslash_16 on Tuesday March 10, 2015 @10:47PM (#9182254)
Is there a good book or website to learn about prototypical inheritance? I've read a lot of Crockford's book and some stuff online about it, but I've never run across the pattern you use above.

It would be great to know what the benefits are vs declaring function literals on an object, or declaring a function directly on Bar's prototype.

Re:React v0.13 released by cstrahan on Wednesday March 11, 2015 @12:41AM (#9182616)
Mozilla's documentation does a good job explaining prototypal inheritance:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inhe...

Re:React v0.13 released by jurassic on Wednesday March 11, 2015 @01:04AM (#9182667)
My "Aha!" moment came while reading this Kyle Simpson blog series http://davidwalsh.name/javascript-objects