How to use the riot.register function in riot

To help you get started, we’ve selected a few riot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iq3addLi / riot_v4_realworld_example_app / src / Domain / UseCase / ApplicationUseCase.ts View on Github external
        this.scenes.forEach( scene => register( scene.name, scene.component ) ) // memo: register() does not allow duplicate register.
        // register error view controller
github Acesmndr / chrome-extension-boilerplate-riot / src / popup / plugins / __tests__ / route.spec.js View on Github external
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();
github Acesmndr / chrome-extension-boilerplate-riot / src / popup / plugins / __tests__ / route.spec.js View on Github external
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();
github riot / route / src / components.js View on Github external
export default function registerGlobally() {
  register('router', Router)
  register('route', Route)
}
github vogloblinsky / web-components-benchmark / todomvc / riot / js / app.js View on Github external
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'));
github vogloblinsky / web-components-benchmark / pascal-triangle / riot / js / app.js View on Github external
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'));
github nesterow / frontless / assets / pages / index.js View on Github external
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)
    }
  })
github vogloblinsky / web-components-benchmark / todomvc / riot / js / app.js View on Github external
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'));
github riot / route / src / components.js View on Github external
export default function registerGlobally() {
  register('router', Router)
  register('route', Route)
}