Mithril now can walks by itself
This commit is contained in:
20
assets/js/models/post.js
Normal file
20
assets/js/models/post.js
Normal file
@@ -0,0 +1,20 @@
|
||||
let m = require('mithril')
|
||||
|
||||
var post = {
|
||||
list: [],
|
||||
curStatus: 3,
|
||||
interval: 10000,
|
||||
loadList: function() {
|
||||
return m.request({
|
||||
method: 'GET',
|
||||
url: '/api/posts/' + post.curStatus,
|
||||
withCredentials: true
|
||||
})
|
||||
.then(function(result) {
|
||||
post.list = result.data
|
||||
console.log('cek')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = post
|
||||
Reference in New Issue
Block a user