rumkin / pill

Add dynamic content loading to static sites with only 1 KiB of JS
https://rumkin.github.io/pill/
MIT License
383 stars 18 forks source link

custom events #25

Closed tamb closed 4 years ago

tamb commented 4 years ago

Each stage of content fetching and rendering should offer namespaced events. like pill.mounted and the detail object contains the same data the hook would This opens the door for other scripts to hook into pill without being in the same module.

rumkin commented 4 years ago

Agree this is useful enhancement. I wold like to see this with such syntax:

event-name = namespace ':' event
namespace = a-z
event = a-z-

Examples:

pill:mount
pill:ready
pill:complex-event

In my opinion it's closer to XML-namespaces which also are separated with the colon.