No description
Find a file
2025-09-17 12:57:00 +02:00
page Fix spelling in state page 2023-09-20 13:36:14 +02:00
.editorconfig Add editorconfig 2025-09-17 12:57:00 +02:00
better.js Refactor Better.js 2022-02-08 19:00:18 +01:00
css.js Change $ in CSS to prefix placeholder 2022-06-09 14:03:19 +02:00
css.md Add markdown file documenting css.js features 2021-10-19 20:37:04 +02:00
debounce.js Add "running" property to debounce wrapper 2022-02-08 15:27:55 +01:00
element.js Apply getter-transforms on change functions 2023-10-17 10:34:38 +02:00
index.html Add some helpful comments to state.js 2023-09-19 16:58:43 +02:00
jsconfig.json Add in-order script 2025-03-21 15:04:34 +01:00
license Initial commit 🎊 2020-10-27 16:28:02 +01:00
listener.js Add State library and deprecate speaker & listener 2023-09-18 14:58:40 +02:00
listener.md Document listener 2022-03-17 09:49:57 +01:00
meta.js Add meta helper 2022-06-13 15:43:07 +02:00
pqueue.js Fix syntax error in pqueue 2023-09-19 17:39:11 +02:00
readme.md Add State library and deprecate speaker & listener 2023-09-18 14:58:40 +02:00
skooma.js Allow returning text in skooma bind method 2023-09-19 17:39:11 +02:00
skooma.md Extend skooma.text function to support template strings 2021-12-26 17:54:04 +01:00
speaker.js Add State library and deprecate speaker & listener 2023-09-18 14:58:40 +02:00
speaker.md Split ImmediateSpeaker into separate class 2021-11-25 10:37:16 +01:00
state.js Fix two bugs in state.js 2023-09-20 21:20:27 +02:00
template.js Further refactor code 2023-09-18 11:45:36 +02:00
ulid.js Add simple ULID generator 2021-09-20 20:48:55 +02:00
use.js Make use.js remove the use attribute to prevent repetition 2022-07-01 09:24:14 +02:00
use.md Add use.whenReady function 2021-11-03 20:51:17 +01:00

DarkWiiPlayer/JS

A collection of general-purpose Javascript snippets/modules that I end up copy-pasting around more often than necessary.


So what does it all do?

Skooma

Generate HTML and SVG DOM nodes more easily and do stuff with them. Feels like an in-between of using a templating language and writing lisp code. Overall very recommendable.

Element

the second iteration of improved HTMLElement but this time in a function to support inheriting from other classes for extending builtin elements.

CSS

Generate CSS from JS objects. Yes, you can generate CSS from JSON now. Or from YAML. Or from whatever you want, really.

State

Combines both Listener and Speaker into one convenient class that batches and defers changes by default.

Listener

(Deprecated; use State instead)

A proxy object that fires a callback when certain (or all) properties are changed.

Speaker

(Deprecated; use State instead)

Simple messaging helper that uses microtasks by default.

Debounce

Debouncing wrapper for functions to avoid repeated execution of expensive code.

Template

Turns template literals directly into HTML templates. Just read the code, it's like 5 lines or so.

Storage

Currently a sngle class ObjectStorage implementing the API of the Storage class using a plain JS Map as backend. This is mostly meant as a page-local fallback to LocalStorage and SessionStorage.

Use

Allows you to apply code to HTML elements by looking for a use attribute and running it as code on the element.

Pqueue

Ensures in-order promise resolution and optionally limits parallel execution.