Skip to content

Ability to provide a callback function to metabind button #580

Open
@vitalybe

Description

@vitalybe

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

Metabind buttons are great when you use them from markdown but if I want to use them from API then the fact that I can't connect them to a simple javascript callback is very annoying. Sure I can use evaluate or give them source file path, but I am already in code, it'd be much simpler to just give it a callback.

Describe the Feature you'd like

Give me a simple way to invoke callback, e.g.:

{
          type: ButtonActionType.JS_CALLBACK,
          value: () => { console.log("Hello world!")
}

Alternatives

The following types are as close as we can get:

  • inlineJS
  • js

Which is not ideal, especially if you want to share some context between your code and the button callback

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions