Merge branch 'master' into next
This commit is contained in:
commit
0aba8aa4bd
2 changed files with 13 additions and 1 deletions
|
|
@ -319,10 +319,14 @@ Mithril = m = new function app(window) {
|
||||||
|
|
||||||
//model
|
//model
|
||||||
m.prop = function(store) {
|
m.prop = function(store) {
|
||||||
return function() {
|
var f = function() {
|
||||||
if (arguments.length) store = arguments[0]
|
if (arguments.length) store = arguments[0]
|
||||||
return store
|
return store
|
||||||
}
|
}
|
||||||
|
f.toJSON = function() {
|
||||||
|
return store
|
||||||
|
}
|
||||||
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
m.deferred = function() {
|
m.deferred = function() {
|
||||||
|
|
|
||||||
|
|
@ -419,6 +419,14 @@ function testMithril(mock) {
|
||||||
prop("foo")
|
prop("foo")
|
||||||
return prop() == "foo"
|
return prop() == "foo"
|
||||||
})
|
})
|
||||||
|
test(function() {
|
||||||
|
var prop = m.prop("test")
|
||||||
|
return JSON.stringify(prop) == "\"test\""
|
||||||
|
})
|
||||||
|
test(function() {
|
||||||
|
var obj = { prop: m.prop("test") }
|
||||||
|
return JSON.stringify(obj) == "{\"prop\":\"test\"}"
|
||||||
|
})
|
||||||
|
|
||||||
//m.request
|
//m.request
|
||||||
test(function() {
|
test(function() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue