mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
properly export convert function of flux container converter fix
This commit is contained in:
parent
99a5b2d5d2
commit
e44c7da7e3
1 changed files with 14 additions and 12 deletions
|
@ -1,15 +1,17 @@
|
|||
/// FluxContainerConverter.js
|
||||
/// This is an ugly workaround found here https://github.com/facebook/flux/issues/351 to make Flux Containers work with ES6
|
||||
|
||||
module.exports = {
|
||||
convert: function(containerClass) {
|
||||
const tmp = containerClass;
|
||||
containerClass = function(...args) {
|
||||
return new tmp(...args);
|
||||
};
|
||||
containerClass.prototype = tmp.prototype;
|
||||
containerClass.getStores = tmp.getStores;
|
||||
containerClass.calculateState = tmp.calculateState;
|
||||
return containerClass;
|
||||
}
|
||||
};
|
||||
|
||||
function convert(containerClass) {
|
||||
const tmp = containerClass;
|
||||
containerClass = function(...args) {
|
||||
return new tmp(...args);
|
||||
};
|
||||
containerClass.prototype = tmp.prototype;
|
||||
containerClass.getStores = tmp.getStores;
|
||||
containerClass.calculateState = tmp.calculateState;
|
||||
return containerClass;
|
||||
}
|
||||
|
||||
export {convert}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue