@webqit/oohtml 4.1.5 → 4.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data-binding.js +1 -1
- package/dist/data-binding.js.map +2 -2
- package/dist/main.js +1 -1
- package/dist/main.js.map +2 -2
- package/dist/main.lite.js +13 -13
- package/dist/main.lite.js.map +2 -2
- package/package.json +1 -1
- package/src/data-binding/index.js +20 -4
package/package.json
CHANGED
|
@@ -52,10 +52,18 @@ function createDynamicScope( config, root ) {
|
|
|
52
52
|
if ( _( root ).has( 'data-binding' ) ) return _( root ).get( 'data-binding' );
|
|
53
53
|
const scope = Object.create( null ), abortController = new AbortController;
|
|
54
54
|
scope[ '$exec__' ] = ( target, prop, ...args ) => {
|
|
55
|
-
|
|
55
|
+
const exec = () => {
|
|
56
|
+
try { target[ prop ]( ...args ); }
|
|
57
|
+
catch( e ) { console.error( `${ e.message } at ${ e.cause }` ); }
|
|
58
|
+
};
|
|
59
|
+
realdom.schedule( 'write', exec );
|
|
56
60
|
};
|
|
57
61
|
scope[ '$assign__' ] = ( target, prop, val ) => {
|
|
58
|
-
|
|
62
|
+
const exec = () => {
|
|
63
|
+
try { target[ prop ] = val; }
|
|
64
|
+
catch( e ) { console.error( `${ e.message } at ${ e.cause }` ); }
|
|
65
|
+
};
|
|
66
|
+
realdom.schedule( 'write', exec );
|
|
59
67
|
};
|
|
60
68
|
Observer.intercept( scope, {
|
|
61
69
|
get: ( e, recieved, next ) => {
|
|
@@ -126,7 +134,11 @@ async function mountDiscreteBindings( config, ...entries ) {
|
|
|
126
134
|
const compiled = compileDiscreteBindings( config, template.expr );
|
|
127
135
|
const { scope, bindings } = createDynamicScope.call( this, config, textNode.parentNode );
|
|
128
136
|
Object.defineProperty( textNode, '$oohtml_internal_databinding_anchorNode', { value: anchorNode, configurable: true } );
|
|
129
|
-
|
|
137
|
+
try {
|
|
138
|
+
bindings.set( textNode, { state: await ( await compiled.bind( textNode, scope ) ).execute(), } );
|
|
139
|
+
} catch( e ) {
|
|
140
|
+
console.log(e);
|
|
141
|
+
}
|
|
130
142
|
}
|
|
131
143
|
}
|
|
132
144
|
|
|
@@ -148,7 +160,11 @@ async function mountInlineBindings( config, ...entries ) {
|
|
|
148
160
|
const { scope, bindings } = createDynamicScope.call( this, config, node );
|
|
149
161
|
const signals = [];
|
|
150
162
|
Object.defineProperty( node, '$oohtml_internal_databinding_signals', { value: signals, configurable: true } );
|
|
151
|
-
|
|
163
|
+
try {
|
|
164
|
+
bindings.set( node, { signals, state: await ( await compiled.bind( node, scope ) ).execute(), } );
|
|
165
|
+
} catch( e ) {
|
|
166
|
+
console.log(e);
|
|
167
|
+
}
|
|
152
168
|
}
|
|
153
169
|
}
|
|
154
170
|
|