Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var riot = require('riot/riot.js')
require('./async')
module.exports = riot.tag('mount', '<div></div>', function (opts) {
// It's important that the child tag will contain a proper
// `this.parent` or `this.opts.parent` property which will
// reference to the current tag
var _opts = { parent: this }
riot.mount(this.target, 'mount-child', _opts)[0]
})
riot.tag('mount-child', '{value}', function (opts) {
var self = this
self.value = ''
self.asyncStart()
setTimeout(function () {
self.value = 'ok'
self.update()
self.asyncEnd()
}, 10)
})
var riot = require('riot/riot.js')
require('./async')
module.exports = riot.tag('mount', '<div></div>', function (opts) {
// It's important that the child tag will contain a proper
// `this.parent` or `this.opts.parent` property which will
// reference to the current tag
var _opts = { parent: this }
riot.mount(this.target, 'mount-child', _opts)[0]
})
riot.tag('mount-child', '{value}', function (opts) {
var self = this
self.value = ''
self.asyncStart()
setTimeout(function () {
self.value = 'ok'
var riot = require('riot/riot.js')
module.exports = riot.tag('long-running', '{value}', function (opts) {
var self = this
self.value = ''
self.asyncStart()
setTimeout(function () {
self.value = opts.value || 'ok'
self.update()
self.asyncEnd()
}, 500)
})
var riot = require('riot/riot.js')
module.exports = riot.tag('async', '{value}', function (opts) {
var self = this
self.value = ''
self.asyncStart()
setTimeout(function () {
self.value = 'ok'
self.update()
self.asyncEnd()
}, 10)
})
var riot = require('riot/riot.js')
require('./sync')
require('./async')
module.exports = riot.tag('nested', '{value}',
function (opts) {
var self = this
self.value = ''
self.asyncStart()
setTimeout(function () {
self.value = 'ok'
self.update()
self.asyncEnd()
}, 10)
}
)
var riot = require('riot/riot.js')
module.exports = riot.tag('async-chain', '{value}', function (opts) {
var self = this
self.asyncStart()
self.asyncEnd()
self.asyncStart()
self.asyncEnd()
self.asyncStart()
setTimeout(function () {
self.asyncEnd()
self.asyncStart()
setTimeout(function () {
self.value = 'ok'
self.update()
var riot = require('riot/riot.js')
module.exports = riot.tag('sync', '{value}', function (opts) {
this.value = 'ok'
})