3 ms·
The API could use some work. To implement the simplest example, I need to remember patterns like: > eventContract.dispatchTo(goog.bind(dispatcher.dispatch, di
by floatrock 12y ago
The API could use some work. To implement the simplest example, I need to remember patterns like:
> eventContract.dispatchTo(goog.bind(dispatcher.dispatch, dispatcher));
imho, there's a problem if you need to dust off your gang of four book to understand the API. Might as well include an AbstractSingletonProxyFactoryBean.
- couchand 12y agoThe API could certainly use some work, and it's worse than you mention. If it were just a matter of applying widely-known Gang of Four patterns it would be fine. All over the place it looks like the designer didn't realize there's a built-in Function.prototype.bind.
- gefh 12y agoIn IE8 and FF3.6, there isn't. If you believe netmarketshare.com, that's 20% of users right there.
- coldtea 12y agoIIRC, lots of Google products (like Google Docs) don't support those browsers entirely.
- superlupo 12y agoIf you are not relying on edge case behaviour of Function.prototype.bind, including the polyfill here should be enough: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Compatibility https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...