Open
Conversation
* feat: custom dom events * fix: error message * fix: ci now executes on any PR * fix: eslint * refactor: events with no details now returns null instead of undefined * refactor: minor fixes * docs: updated * fix: options spread and _setprogress uninitialized guard * fix: resetprogress guard against uninitialized elements
Repository owner
locked and limited conversation to collaborators
Apr 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issues:
Added
CustomEventdispatching across all lifecycle methods in both jQuery and vanilla implementations.LoadgoEventMapand augmentedHTMLImageElement.addEventListeneroverloads.setprogress()now dispatchesloadgo:errorwhen called on an uninitialized element.onTreshold: map of progress values (0–100) to callbacks. Each callback fires once when progress first reaches or crosses its key.loop()now stores loopDuration and syncsloopToggle(the direction flag) into element state on each tickLoadgo.pause()/$el.loadgo('pause'): clears the interval, sets paused: true, fires loadgo:pause with currentprogress — no-op if not looping
Loadgo.resume()/$el.loadgo('resume'): restarts the interval from the saved loopToggle and current progress,fires loadgo:resume — no-op if not paused
shared _startLoopIntervalhelper to avoid code duplication betweenloop()andresume()pause()andresume()toLoadgoAPIand jQuery JQuery interfaceloadgo:pauseandloadgo:resumetoLoadgoEventMap(typed asCustomEvent<LoadgoDetail>)Loadgo.initAll(selector, options)for vanilla-JS plugin which allows batch-initializing multipleChanged
loadgo:optionsdetail is now a shallow copy of the merged options object, preventing internal state mutation.loadgo:init,loadgo:start,loadgo:cycle,loadgo:destroy) setevent.detailtonullinstead ofundefined.$filterrenamed tofilterin jQuery_setprogressinternal helper.Fixed
resetprogress()now guards against calls on uninitialized elements (prevented spuriousloadgo:resetevents).Events reference
event.detailloadgo:initinit()completesnullloadgo:errorimgelement, loop/stop on uninitialized, double loop){ message: string }loadgo:optionsoptions()is called as a setter after initLoadgoOptionsobjectloadgo:progresssetprogress()is called{ progress: number }loadgo:complete{ progress: 100 }loadgo:resetresetprogress()is called{ progress: 0 }loadgo:startloop()startsnullloadgo:cyclenullloadgo:stopstop()is called{ progress: 100 }loadgo:destroydestroy()completesnull