@base-framework/organisms
Version:
This will add default organisms to the base framework.
3 lines (2 loc) • 844 B
JavaScript
import{a as e}from"./chunk-XVC4DNLY.js";import{Span as l}from"@base-framework/atoms";import{Component as f,SimpleData as a}from"@base-framework/base";var o=new a({date:0}),p=6e4,m=new e(p,()=>{o.increment("date")}),t=0,h=()=>{++t===1&&m.start()},u=()=>{t>0&&--t===0&&m.stop()},c=new a({date:0}),S=1e3,T=new e(S,()=>{c.increment("date")}),r=0,x=()=>{++r===1&&T.start()},w=()=>{r>0&&--r===0&&T.stop()},s=class extends f{setData(){return o}afterSetup(){this.retainTimer()}beforeDestroy(){this.releaseTimer()}retainTimer(){h()}releaseTimer(){u()}render(){return l({class:this.class,text:this.getTime(),onSet:["date",()=>this.getTime()]})}getTime(){let i=this.dateTime;return this.filter?this.filter(i):i}},n=class extends s{setData(){return c}retainTimer(){x()}releaseTimer(){w()}};export{s as a,n as b};
//# sourceMappingURL=chunk-SSLDZOAH.js.map