Currently, the library provides the on() utility for custom events, but native Figma events can only be subscribed to using figma.on() directly in my main.ts.
Current Problem:
figma.on("selectionchange", () => {
// Must use figma.on() directly
});
There's no way to use the library's event utilities (like on() or once()) for native Figma events like selectionchange, currentpagechange, etc.
Proposed Solution:
Extend the existing on() and once() utilities to support native Figma events, or add new utilities specifically for Figma native events.
Benefits:
- Consistent event handling API across custom and native events
- Access to the library's event management features for native events
- Better integration with the library's event system
Currently, the library provides the
on()utility for custom events, but native Figma events can only be subscribed to usingfigma.on()directly in mymain.ts.Current Problem:
There's no way to use the library's event utilities (like
on()oronce()) for native Figma events likeselectionchange,currentpagechange, etc.Proposed Solution:
Extend the existing
on()andonce()utilities to support native Figma events, or add new utilities specifically for Figma native events.Benefits: