move Deferred constructor out of m.deferred
This commit is contained in:
parent
f832b67585
commit
bf288b09c5
1 changed files with 127 additions and 129 deletions
|
|
@ -563,7 +563,6 @@ Mithril = m = new function app(window, undefined) {
|
||||||
cellCache[cacheKey] = undefined
|
cellCache[cacheKey] = undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
var none = {}
|
|
||||||
function newPromisedProp(prop, promise) {
|
function newPromisedProp(prop, promise) {
|
||||||
prop.then = function () {
|
prop.then = function () {
|
||||||
var newProp = m.prop()
|
var newProp = m.prop()
|
||||||
|
|
@ -584,7 +583,8 @@ Mithril = m = new function app(window, undefined) {
|
||||||
return prop
|
return prop
|
||||||
}
|
}
|
||||||
m.deferred = function () {
|
m.deferred = function () {
|
||||||
|
return newPromisedProp(m.prop(), new Deferred())
|
||||||
|
}
|
||||||
// Promiz.mithril.js | Zolmeister | MIT
|
// Promiz.mithril.js | Zolmeister | MIT
|
||||||
function Deferred(fn, er) {
|
function Deferred(fn, er) {
|
||||||
// states
|
// states
|
||||||
|
|
@ -712,8 +712,6 @@ Mithril = m = new function app(window, undefined) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return newPromisedProp(m.prop(), new Deferred())
|
|
||||||
}
|
|
||||||
m.sync = function(args) {
|
m.sync = function(args) {
|
||||||
var method = "resolve"
|
var method = "resolve"
|
||||||
function synchronizer(pos, resolved) {
|
function synchronizer(pos, resolved) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue