var Reflux = require('reflux')
var Actions = Reflux.createActions(['increment', 'decrement', 'changeBy']);
class MyStore extends Reflux.Store {
constructor()
{
super();
this.state = {count: 0};
this.listenToMany(Actions);
//this.listenables = Actions; // <- would work equally well
}
increment()
{
var newCount = this.state.count + 1;
this.setState({count: newCount});
}
decrement()
{
var newCount = this.state.count - 1;
this.setState({count: newCount});
}
changeBy(amount)
{
var newCount = this.state.count + amount;
this.setState({count: newCount});
}
}
then:
TypeError: Super expression must either be null or a function, not undefined
at _inherits (/Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:975)
at /Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:1461
at Object. (/Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:2095)
at Module._compile (module.js:660:30)
at loader (/Users/kingangeltot/Applications/git_work/node_work/universal/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/kingangeltot/Applications/git_work/node_work/universal/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
Confirmed that this works fine in normal JS: jsfiddle
I don't do typescript, and it's not a JS library error. So unless someone comes along here that does typescript, I think your best bet is stack overflow.
version: reflux@^6.4.1
then:
TypeError: Super expression must either be null or a function, not undefined at _inherits (/Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:975) at /Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:1461 at Object. (/Users/kingangeltot/Applications/git_work/node_work/universal/test.js:1:2095)
at Module._compile (module.js:660:30)
at loader (/Users/kingangeltot/Applications/git_work/node_work/universal/node_modules/babel-register/lib/node.js:144:5)
at Object.require.extensions.(anonymous function) [as .js] (/Users/kingangeltot/Applications/git_work/node_work/universal/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)