Skip to content

Commit

Permalink
keylime_doc
Browse files Browse the repository at this point in the history
  • Loading branch information
neodigm committed Aug 17, 2024
1 parent f565849 commit ebae8e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@

<hr data-n55-theme="brand" data-n55-size="xlarge">
<p>stuff</p>
<neodigm-widget data-n55-widget-config="{conf:'', ampm:'',mobile:''}" data-n55-widget-id="a55_bcg_word_skulduggery"></neodigm-widget>
<!-- temp code -->
<button
onClick="doBefore()">show unistore</button>
Expand Down
14 changes: 7 additions & 7 deletions dist/neodigm55__v3_5.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,19 +874,19 @@ class NeodigmKeylime { // Universal Click / left click / long tap / body exit
static subscribe( eventID, callbackF, useCapture = true ){ // USAGE: NeodigmKeylime.subscribe("click", (ev)=>{console.log("dux")})
if( this.bIsInit && !this.bIsPause && eventID && callbackF ){
const subscriberID = neodigmUtils.genHash( eventID + callbackF )
if( !this.subscribersKL[ subscriberID ] ){
if( !this.subscribersKL[ subscriberID ] ){ // once | a subscriber is unique by event type e.g., click
this.subscribersKL[ subscriberID ] = { "eventID": eventID, "callbackF": callbackF }
if( !this.listenersKL[ eventID ] ){
if( !this.listenersKL[ eventID ] ){ // once
this.listenersKL[ eventID ] = this._d[ neodigmOpt.N55_APP_STATE.CONTEXT ]
.addEventListener( eventID, (ev)=>{ NeodigmKeylime.fire(ev) }, useCapture )
if( neodigmOpt.N55_DEBUG_lOG ) console.log( "~KeyLimeN55 subscrb | ", this.subscribersKL, this.listenersKL)
}
}
console.log( "~~~ kl this.subscribersKL, this.listenersKL | " , this.subscribersKL, this.listenersKL) // TODO Make this system deb tog
return subscriberID;
}
}
return false;
}
static unsubscribe( subscriberID ){ // no need to unlisten at dom level
static unsubscribe( subscriberID ){ // no need to unlisten at DOM level because there is a 1:M (subcrb:dom event)
if( this.bIsInit && !this.bIsPause ){
if( subscriberID && this.subscribersKL[ subscriberID ] ){
delete this.subscribersKL[ subscriberID ]
Expand All @@ -898,8 +898,8 @@ class NeodigmKeylime { // Universal Click / left click / long tap / body exit
static fire( ev ){
if( this.bIsInit && !this.bIsPause ){
console.log( "~~~ fire | " , ev )
// push event onto macro stack, if in recording state
// iterate object firing callback if eventID matches
// TODO push event onto macro stack, if in recording state
// TODO iterate object firing callback if eventID matches
return true;
}
return false;
Expand Down

0 comments on commit ebae8e4

Please sign in to comment.