How to use the riot.util 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 riot / animore / lib / helpers.js View on Github external
import anime from 'animejs'
import riot from 'riot'

const riotExtend = riot.util.misc.extend
const slice = [].slice

export const extend = riotExtend

/**
 * Animation trigger when a tag gets mounted
 * @param   { HTMLElement } root - animate tag root node
 * @param   { Object } opts - animate tag options
 */
export function onMount(root, opts) {
  if (!opts.mount) return
  anime(extend({}, opts.mount, {
    targets: root,
    begin() {
      root.style.visibility = null
      if (opts.mount.begin) opts.mount.begin(...arguments)
github leekangtaqi / ninjajs / src / application.js View on Github external
}
		this.framework = riot;
		this.container = container;
		let finalReducer = { ...reducer, ...formReducer };
		this.reducer = finalReducer;
		this.middlewares = middlewares;
		this.buildInProps = ['env', 'entry', 'context', 'mode', 'routes'];
		this._mode = 'hash';
		this._store = configureStore(state, this.reducer, middlewares, this._mode);
		this.router(router);
		this._context = {
				store: this._store,
				hub: router.hub,
				tags: {}
		};
		riot.util.tmpl.errorHandler = e => {}
		this.emitter = riot.observable({});
		container.widgets = this._widgets = {};
	}