A library of commonly used JavaScript tools and helpers by Becklyn
BSD-3-CLAUSE License
Bot releases are visible (Hide)
storeInLocalStorage()
and fetchFromLocalStorage()
.json
json
(#245) bb01411storeInLocalStorage()
and fetchFromLocalStorage()
268f198json
dbc6e42classes()
is now variadic and can also take string arguments. Also any truthy/falsy values are now supported in objects.null
as element to parseElementAsJson()
null
as element to parseElementAsJson()
2c12c80classes()
+ make variadic 2b707efpopup-interaction::initDismissableContainer()
now returns the close function. This way you can wire up your own close buttons, sopopup-interaction::initDismissableContainer()
can now handle multiple opener triggers.Fix apparently broken 5.5.1
build.
Also:
(parallel release to 4.6.0
)
formatDateTime()
and formatDateTime()
.DateFormatter
.popup-interaction::initDismissableContainer()
and popup-interaction::registerBodyClickHandler()
.useMediaQueryMatcher(mediaQueryMatcher)
.MediaQueryMatcher
.useMediaQueryMatcher()
preact hook (#240) bbf4745useMediaQueryMatcher()
preact hook c9c66a8MediaQueryMatcher
(#239) 98f8c76MediaQueryMatcher
6760847dom/wire/wireSourceTargetLists()
mediaQueryMatcher()
as a for attaching event listeners to window.matchMedia()
without checking for the existence of addListener()
or addEventListener()
yourself.storage/local-storage::persistedToggle
ts-toolbelt
to v4params
are set in mountJsx
, they only need to be a partial set of the props of the component now (as the rest can come from the mounted JSON container).onOff
for easy event use in (preact) hooks.doMount
into specialized methods. This refactoring allows us to type inference parameters that your function or component requires:
mount
for functionsmountClass
for class componentsmountJsx
for Preact componentsinterface ConfigInterface {
a: string;
b: number;
c: {
foo: string;
bar: string;
};
}
// before
let config = parseElementAsJson(htmlScriptTagElement) as ConfigInterface;
let otherConfig = safeParseJson("β¦") as ConfigInterface;
// after
let config = parseElementAsJson<ConfigInterface>(htmlScriptTagElement);
let otherConfig = safeParseJson<ConfigInterface>("β¦");
network.ts
's isStatusFailure()
secure
setting for cookies not properly inferring HTTPS statusvoid
instead of any
, as we're doing nothing with the MountableFunction's return value 2c12a4edoMount
into specialized methods 466dd24isStatusFailure()
(#224) a96275eisStatusFailure()
29e88c9β οΈ broken release, go directly to 3.1.5
formatDateTime()
and formatDateTime()
.DateFormatter
.isStatusFailure()
(#224) a96275eisStatusFailure()
29e88c9initFromGlobalData()
if the element is not missing, but has an invalid structure. Ignore missing keys.inNextFrame()
timing function.hasOwnProperty()
in all of mojave's functions.inNextFrame()
(#222) 3714b00inNextFrame()
031a17ainitFromGlobalData()
.toggleClass
2625bc2initFromGlobalData()
.toggleClass()
.initFromGlobalData()
6fc22d8