jeudi 15 mars 2018

Handling Mixins with Ember CLI Typescript

Just wondering how / what is the best way to properly handle mixins with a typed ember application. Obviously eliminating mixins from the application would be best; however, most addons do not support typescript yet. With that said, what would be the best way to utilize ember-simple-auth application route mixin (or any of their mixins for that matter). I have not tested the following code but my guess is that something along these lines should work; however, it just feels a bit odd:

import Route from '@ember/routing/route';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';

export default class ApplicationRoute extends Route.extend(ApplicationRouteMixin, {
  // Prototype Code Here?
}) {
  // Class TS Code Here?
}

Once again, I have not tested this and am just beginning to embark on the TS journey so bear with me. Any help and clarification would be appreciated.




Aucun commentaire:

Enregistrer un commentaire