Merge pull request #54 from thatsmydoing/master
Allow m.prop to be JSON.stringify-ed
This commit is contained in:
commit
8b6c2c381a
2 changed files with 13 additions and 1 deletions
|
|
@ -319,10 +319,14 @@ Mithril = m = new function app(window) {
|
|||
|
||||
//model
|
||||
m.prop = function(store) {
|
||||
return function() {
|
||||
var f = function() {
|
||||
if (arguments.length) store = arguments[0]
|
||||
return store
|
||||
}
|
||||
f.toJSON = function() {
|
||||
return store
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
m.deferred = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue