stencil-quantum
Version:
Experience the quantum realm of stencil.
1 lines • 1.65 kB
JavaScript
import{g as e,f as o,h as r}from"./p-e5446afd.js";import{h as u,P as s,t as i}from"./p-75cb2ba0.js";export{a as Catch,b as Context,C as ContextError,E as Entanglement,I as Implement,O as Observe,c as Provide,P as Provider,Q as QuantumError,R as React,T as Throw,h as hookComponent,l as log,n as nop,t as throwQuantum}from"./p-75cb2ba0.js";function m(t){return function(n,o){var r;const a=null!==(r=t.on)&&void 0!==r?r:o;let c,l=n[o];u(n,"componentWillLoad",(n=>{const o=e(n);try{c=s.find(o,t.emitter,t.namespace),l&&c.retrieve().emit(a,l),c.hook(o)}catch(t){}return()=>{try{c&&c.unhook(o),c=s.find(o,t.emitter),l&&c.retrieve().emit(a,l),c.hook(o)}catch(t){i(o,t)}}})),delete n[o]&&Object.defineProperty(n,o,{get:()=>l,set:t=>{null==c||c.retrieve().emit(a,t),l=t},enumerable:!0,configurable:!0})}}function d(t){return function(n,r){var a;const c=null!==(a=t.on)&&void 0!==a?a:r;let l,m=n[r];const d=t=>{m=t,o(l)};u(n,"componentWillLoad",(n=>{let o,r;l=e(n);const a=(n=(()=>{}))=>{try{o||(o=s.find(l,t.emitter,t.namespace),o.listen((t=>{null==r||r.off(c,d),t.on(c,d),r=t})))}catch(t){n(t)}};return a(),()=>a((t=>i(l,t)))})),delete n[r]&&Object.defineProperty(n,r,{get:()=>m,set:d,enumerable:!0,configurable:!0})}}function f(t={}){return t}function p(t={}){return t}function v(t,n){return r("quantum-consumer",{bind:t.bind,onUpdate:n=>t.onUpdate(n.detail.value,n.detail.provider)},n)}function g(t,n){return r("quantum-provider",{bind:t.bind,onUpdate:n=>{var e;return null===(e=t.onUpdate)||void 0===e?void 0:e.call(t,n.detail.value,n.detail.provider)},value:t.value},n)}export{m as Emit,v as QuantumConsume,g as QuantumProvide,d as Receive,p as qa,f as qt}