single-spa-riot
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

single-spa-riot

Generic lifecycle hooks for Riot.js applications that are registered as applications of single-spa.

NPM Build Status minified

Installation

npm install --save single-spa-riot

Usage

import * as Riot from 'riot';
import singleSpaRiot from 'single-spa-riot';
import App from './App.riot'
 
const riotLifecycles = singleSpaRiot({
  rootComponent: Riot.component(App),
  domElementGetter: () => document.getElementById('#app')
});
 
export const bootstrap = riotLifecycles.bootstrap;
 
export const mount = riotLifecycles.mount;
 
export const unmount = riotLifecycles.unmount;

Options

All options are passed to single-spa-riot via the opts parameter when calling singleSpaRiot(opts). The following options are available:

  • domElementGetter: (required) the callback to get root component mount element.
  • rootComponent: (optional and replaces appOptions.loadRootComponent) the root riot component.
  • loadRootComponent: (optional and replaces appOptions.rootComponent) A promise that resolves with your root component. This is useful for lazy loading.

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i single-spa-riot

    Weekly Downloads

    4

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    51.6 kB

    Total Files

    8

    Last publish

    Collaborators

    • joeldenning
    • ariesjia