UNPKG

@zeppos/zml

Version:

A Mini Library of ZeppOS MiniApp

2 lines (1 loc) 748 B
class e{constructor(e){this.global=e}getValue(e){return this.global[e]}setValue(e,s){return this.global[e]=s}deleteKey(e){delete this.global[e]}}class s extends e{constructor(){super(__$$app$$__.__globals__.__scopedGlobals__._$mgr$_[__$$module$$__.id])}}const[{IDisposable:o,Disposable:t}]=function(...e){const s=getApp().$m;return e.reduce(((e,o)=>(e.push(s[o]),e)),[])}("Dispose");class l{constructor(e){this.name="ModuleDispose_"+e}dispose(){}}function n(e){const n=new s,_=o(l),r=e[t.dispose]=new _(__$$module$$__.id);return n.setValue(t.dispose,r),{onDestroy(){t.safeDispose(r),n.deleteKey(t.dispose)}}}function _(){return(new s).getValue(t.dispose)}const r="3.0";export{r as API_LEVEL,t as Disposable,_ as getModuleDisposer,n as pagePlugin};