matthewp / corset

Declarative data bindings, bring your own backend.

Home Page:https://corset.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Needed feature - A way to bind global (document, window, etc.) event listeners to the sheet.

opened this issue · comments

I feel as if there are a lot of cases where binding an event listener to the document or window objects is necessary for the functionality of the website to work. I have definitely run into this necessity in a couple of my little side projects.

I propose that a new event-target property (already discussed briefly with Matthew) is added to allow for this functionality. This should be a clean approach to the problem.

body {
  event: custom ${() => this.count++};
  event-target: ${window};
}