Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createTag (tagPath, opts, onReady) {
if (onReady) {
//
// Extend `riot.Tag.prototype` first, so that it would
// contain required `asyncStart` and `asyncEnd`
//
riot.Tag.prototype.asyncStart = function () {
var root = getRootTag(this)
// Use the root tag as the storage, which will be set
// up once when `asyncStart` will be called for the
// first time
root.ssr || (root.ssr = {
asyncCounter: 0,
onReadyStack: [onReady],
ready: false
})
if (root.ssr.ready) {
throw new Error('Calling `tag.asyncStart()` after rendered result ' +
'was already returned')
}
function getRootTag (tag) {
while (tag.parent || tag.opts.parent instanceof riot.Tag) {
tag = tag.parent || tag.opts.parent
}
return tag
}
}
get mode(){
return this._mode;
}
get entry(){
return this._entry;
}
get env(){
return this._env;
}
}
const appCreator = params => new Ninja(params)
const uiLib = riot
appCreator.Component = riot.Tag
export default appCreator
export { connect, provider, uiLib }
return function(entry) {
invariant((typeof entry === 'object' && entry instanceof riot.Tag), `
provider expect a tag instead of ${entry}`);
entry.opts.store = store;
provider = entry;
return provider;
}
}