UNPKG

@surface/custom-element

Version:

Provides support of directives and data binding on custom elements.

24 lines (23 loc) 760 B
import Block from "../block.js"; import PlaceholdeStatement from "../statements/placeholder-statement.js"; export default function placeholderFactory(key, value, observables, factory) { return () => { const block = new Block(); const activator = (parent, host, scope, directives) => { parent.insertBefore(block.start, block.end); const context = { block, directives, factory, host, key, observables, parent, scope, value, }; return new PlaceholdeStatement(context); }; return [block.end, activator]; }; }