goatslacker / alt

Isomorphic flux implementation
http://alt.js.org/
3.45k stars 323 forks source link

[0.18.2] alt.createActions() breaks the inheritance #629

Closed Nicolab closed 8 years ago

Nicolab commented 8 years ago

Hello,

I have upgraded alt and since cannot extends properly a class. alt use the methode of the parent instead of the concret class.

// parent (abstract)
class BaseActions {
  constructor() {
    this.generateActions(
      'fetchDone',
      'fetchFail'
    );
  }

  fetch() {
    console.log('BaseActions.fetch()');
  }
}

// child (concret)
class MyActions extends BaseActions {
  constructor() {
    super();
  }

  fetch() {
    console.log('MyActions.fetch()');
  }
}

export default alt.createActions(MyActions);

In a React component:

myActions.fetch();
// print: BaseActions.fetch()

I suspect getPrototypeChain here

BradHarris commented 8 years ago

Is this still a problem in 0.18.4?

PedroPinheiro commented 8 years ago

yeap