Merge remote-tracking branch 'origin/rewrite' into rewrite
This commit is contained in:
commit
e4a16d3bf4
5 changed files with 187 additions and 142 deletions
|
|
@ -7,18 +7,15 @@ function createStream() {
|
|||
return stream._state.value
|
||||
}
|
||||
initStream(stream, arguments)
|
||||
|
||||
if (arguments.length > 0) updateStream(stream, arguments[0], undefined)
|
||||
|
||||
return stream
|
||||
}
|
||||
function initStream(stream, args) {
|
||||
stream.constructor = createStream
|
||||
stream._state = {id: guid++, value: undefined, error: undefined, state: 0, derive: undefined, recover: undefined, deps: {}, parents: [], errorStream: undefined, endStream: undefined}
|
||||
stream.map = map, stream.ap = ap, stream.of = createStream
|
||||
stream.valueOf = valueOf, stream.toJSON = toJSON
|
||||
stream.valueOf = valueOf, stream.toJSON = toJSON, stream.toString = valueOf
|
||||
stream.run = run, stream.catch = doCatch
|
||||
|
||||
Object.defineProperties(stream, {
|
||||
error: {get: function() {
|
||||
if (!stream._state.errorStream) {
|
||||
|
|
@ -130,10 +127,8 @@ function initDependency(dep, streams, derive, recover) {
|
|||
state.derive = derive
|
||||
state.recover = recover
|
||||
state.parents = streams.filter(notEnded)
|
||||
|
||||
registerDependency(dep, state.parents)
|
||||
updateDependency(dep, true)
|
||||
|
||||
return dep
|
||||
}
|
||||
function registerDependency(stream, parents) {
|
||||
|
|
@ -1082,7 +1077,6 @@ m.route = function($window, renderer, pubsub) {
|
|||
route.prefix = router.setPrefix
|
||||
route.set = router.setPath
|
||||
route.get = router.getPath
|
||||
|
||||
return route
|
||||
}(window, renderService, redrawService)
|
||||
m.mount = function(renderer, pubsub) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue