Skip to content

A possibility to subscribe to Figma native events using the on/once handlers #265

@andrii-bodnar

Description

@andrii-bodnar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions