-
-
Notifications
You must be signed in to change notification settings - Fork 927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Isolate m.prop() and m.deferred() implementations (mostly) #853
Conversation
This mostly isolates the implementations for both of these. Now, everything here calls the method itself, not any of the external methods. Few driveby fixes as well: 1. Git now ignores archive/ again (it's a build artifact, and can be removed when updating `master`) 2. Since I had to rewrite most of the Deferred implementation, the new version passes one of the skipped tests, so it is now enabled.
@IMPinball, what are the performance implications of this? |
About the same. The bottleneck is still in the rendering, which probably On Fri, Nov 20, 2015, 11:50 Richard Eames notifications@github.com wrote:
|
Promises should be slightly faster, but I haven't benchmarked it much. On Fri, Nov 20, 2015, 19:16 Isiah Meadows impinball@gmail.com wrote:
|
I would also like to note that this is slightly breaking. |
That sound like a passing assertion :) What happens in author-land resulting in user error with 3rd party integration should stay there. Mithril already documents its disparities with the spec. There is only so much protection you can reasonably offer! |
Note that this does *not* memoize `then`, another deviation from spec, but it's unlikely this will actually cause very many bugs. It's also a breaking change.
@barneycarroll And a conforming Promises/A+ implementation would see the Another breaking change: m.then() doesn't return a memoized value (which it shouldn't). It's another deviation from spec, but it's the expected behavior - you're changing the internal value of the thenable when you call the function. |
|
/cc @lhorie |
var prop = m.prop() | ||
promise.then(prop) | ||
|
||
prop.then = function (fufill, reject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo... and also why not resolve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't really know
Merging now. Looking at it again, I don't think that it's a broad enough use case yet that the breaking change would cause problems. |
Isolate m.prop() and m.deferred() implementations (mostly)
really nice work @isiahmeadows ! |
@tinchoz49 Thanks! |
This mostly isolates the implementations for both of these. Now, everything
here calls the method itself, not any of the external methods.
Few driveby fixes as well:
when updating
master
)passes one of the skipped tests, so it is now enabled.
Prepares for #800.