Skip to content

Add CommandPalette.version property. #16

Description

@rouilj

Would it be possible to add a version property to CommandPal? Would something like:

class CommandPal {

  version = "0.2.7";

  constructor(options) {
    console.log("CommandPal", { options });
    this.options = options || {};
    this.ps = pubsub.create();
  }

make:

cp = new CommandPal({
         commands: { 
              name: "CommandPal version",
              handler = () => (alert("CommandPal version " + CommandPal.version )),
              },
              name:  "Another version method",
              handler = () => (alert("CommandPal version " + cp.version )),
         }
      });

work?

Also in the docs, the handler definition is shown as:

// Callback function of the command to execute
  handler: (e) => {
    // DO SOMETHING
  }

What is e? From my testing it looks like it is undefined.

I assume there is some mechanism driven off of package.json to keep the version identifier up to date?

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