Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.scenes.forEach( scene => register( scene.name, scene.component ) ) // memo: register() does not allow duplicate register.
// register error view controller
import * as riot from 'riot';
import route from '../route';
riot.register('page', riot.component(''));
riot.register('pagetwo', riot.component(''));
describe('Route specs', () => {
const pageElement = document.createElement('div');
let mountedComponent;
beforeAll(() => {
riot.install(route);
pageElement.id = 'root';
document.body.appendChild(pageElement)
mountedComponent = riot.mount(pageElement, {}, 'page');
});
it('should call the unmount when the route function is called', () => {
const mockFn = jest.fn();
import * as riot from 'riot';
import route from '../route';
riot.register('page', riot.component(''));
riot.register('pagetwo', riot.component(''));
describe('Route specs', () => {
const pageElement = document.createElement('div');
let mountedComponent;
beforeAll(() => {
riot.install(route);
pageElement.id = 'root';
document.body.appendChild(pageElement)
mountedComponent = riot.mount(pageElement, {}, 'page');
});
it('should call the unmount when the route function is called', () => {
const mockFn = jest.fn();
export default function registerGlobally() {
register('router', Router)
register('route', Route)
}
import { register, mount, component } from 'riot';
import myTodo from './my-todo.js';
import todoItem from './todo-item.js';
import todoInput from './todo-input.js';
register('todo-item', todoItem);
mount('todo-item');
register('todo-input', todoInput);
mount('todo-input');
component(myTodo)(document.querySelector('my-todo'));
import { register, mount, component } from 'riot';
import pascalTriangle from './pascal-triangle.js';
import triangleItem from './triangle-item.js';
register('triangle-item', triangleItem);
mount('triangle-item');
component(pascalTriangle)(document.querySelector('pascal-triangle'));
tags.forEach((tag) => {
const component = tag.module.default;
if (component.exports) {
component.exports.state = STATE[component.exports.id || component.name] || component.exports.state;
}
if (!riot.__.globals.COMPONENTS_IMPLEMENTATION_MAP.has(component.name)) {
const rendered = document.querySelector('section[is]')
riot.register(component.name, component)
}
})
import { register, mount, component } from 'riot';
import myTodo from './my-todo.js';
import todoItem from './todo-item.js';
import todoInput from './todo-input.js';
register('todo-item', todoItem);
mount('todo-item');
register('todo-input', todoInput);
mount('todo-input');
component(myTodo)(document.querySelector('my-todo'));
export default function registerGlobally() {
register('router', Router)
register('route', Route)
}