Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elementVoid,
currentPointer,
skipNode,
notifications
} from 'incremental-dom'
import { isIterable, paramCase, SPECT_CLASS } from './util'
attributes.class = applyAttr
attributes.is = (target, name, value) => {
if (target.setAttribute) applyAttr(target, name, value)
return applyProp(target, name, value)
}
attributes[symbols.default] = applyProp
notifications.nodesDeleted = function (nodes) {
nodes.forEach((node) => node[_spect] && node[_spect].dispose())
};
const _target = Symbol.for('spect.target')
const _instance = Symbol.for('spect.instance')
const _spect = Symbol.for('spect')
export default function html(...args) {
let el = this[_target] || this
// tpl string: html`<a>`
let vdom
if (args[0].raw) {
vdom = htm.call(h, ...args)
}</a>
function set_global_state(params) {
var old = {
stores: attributes.__stores,
applyAttr: attributes[symbols.default],
deleted: notifications.nodesDeleted,
}
attributes.__stores = store_handler(params)
attributes[symbols.default] = applyAttribute
notifications.nodesDeleted = cleanup_stores
return old
}
function clean_global_state(old) {
notifications.nodesDeleted = old.deleted
attributes[symbols.default] = old.applyAttr
attributes.__stores = old.stores
}
import { patch, notifications, attributes } from 'incremental-dom';
import inst_watched from './nodes-watched';
import { detacheNode, attacheNode } from './nodes-action';
notifications.nodesDeleted = function (nodes: HTMLDivElement[]) {
nodes.forEach(detacheNode);
};
notifications.nodesCreated = function (nodes: HTMLDivElement[]) {
nodes.forEach(attacheNode);
};
attributes.value = function (el: any, name: string, value: any) {
el.value = value === null || typeof (value) === 'undefined' ? '' : value;
};
attributes.checked = function (el: any, name: string, value: any) {
el.checked = !!value;
};
export default (p_module:any , props_inst:{[key:string]:any}, {key_id,is}:{is:string, key_id:string}) => {
return {