Releases: SilverAssist/next-script-loader
Releases · SilverAssist/next-script-loader
Release list
v0.1.1
Fixed
reload()had no re-entrancy protection: two calls for the same variant in quick succession (before the first's script finished loading) tore down and recreated the script twice, and since removing a<script>element doesn't reliably cancel its in-flight network request, both could execute and each apply their side effects.reload()now shares the in-flight promise for a same-variant call already in progress, the same wayload()already did.
Added
getGeneration()and an optionalunload(atGeneration?)parameter -- a monotonically increasing counter, bumped on everyload()/reload()call, that a delayed unmount cleanup can capture and pass back tounload()to detect it's been superseded by a newer mount and skip itself entirely (including the reference-count decrement).