This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cycle from 'cyclejs'; | |
const { h, Rx } = Cycle; | |
// all html/svg element names << | |
var elements = [ | |
'a', | |
'abbr', | |
'address', | |
'area', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import {Router5, RouteNode} from 'router5'; | |
import logger from '../logger'; | |
// The set of valid sink functions includes synchronous state-affecting router functions that do not require a callback | |
// and which do not have a significant return value other than the router object itself. | |
const validSinkFuncs = ['add','addNode','canActivate','deregisterComponent','navigate','registerComponent','setOption','start','stop']; | |
function validateAndRemapSinkArgument(arg) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require) { | |
var React = require('react'); | |
var paramRegex = /__(\d)+/; | |
var parser = new DOMParser(); | |
var errorDoc = parser.parseFromString('INVALID', 'text/xml'); | |
var errorNs = errorDoc.getElementsByTagName("parsererror")[0].namespaceURI; | |
// turns the array of string parts into a DOM | |
// throws if the result is an invalid XML document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function runInScope(main, sources, context, ...args) { | |
if(!main) { | |
throw new Error('A "main" function must be supplied, which will be called in scope and from which a (sinks) object will be returned'); | |
} | |
if(!sources) { | |
throw new Error('A source drivers object must be supplied, to which scoping can be applied'); | |
} | |
if(!context) { | |
throw new Error('A scope context object must be supplied, either as a string, or as an object of key/value pairs'); | |
} |