DEV: Allow onStateChange callbacks for PM topic tracking state. (PR #14479)

GitHub

I’m pretty sure we follow semver at Discourse so any new functionality should be bumping the minor verison.

The plugin API needs documentation on how this method works.

I’m curious why you extend an object to do this rather than call create with these methods?

I was just following the Ember guide here to define a new class. Do you have an example of how I can pass the functions in when calling create?

It’s true that extend creates a class, but you are only ever making one instance of that class so it’s not very useful. You can pass functions in when calling create

let x = EmberObject.create({
  hello() {
     console.log('world');
  }
});
x.hello();  // works

Had a discussion with @SamSaffron and we’re closing this because we do not want to introduce this API just yet.

The title of this pull request changed from “DEV: Plugin api interface for topic tracking state.” to "DEV: Allow onStateChange callbacks for PM topic tracking state.