Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Nav Patel authored and patelnav committed Jul 5, 2017
0 parents commit 9d2eba9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Based on https://github.com/facebook/flux/issues/351#issuecomment-243175376
import {Container} from 'flux/utils';

export default function FluxContainerCreate(containerClass) {
const tmp = containerClass;
containerClass = function(...args) {
return new tmp(...args);
};
containerClass.prototype = tmp.prototype;
containerClass.getStores = tmp.getStores;
containerClass.calculateState = tmp.calculateState;
return Container.create(containerClass);
}
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "flux-container-create",
"version": "1.0.0",
"description": "Workaround for https://github.com/facebook/flux/issues/351, based on lazy8's code'",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Nav Patel <[email protected]>",
"license": "ISC",
"dependencies": {
"flux": "^3.1.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/patelnav/flux-container-create.git"
},
"keywords": [
"react",
"flux"
],
"bugs": {
"url": "https://github.com/patelnav/flux-container-create/issues"
},
"homepage": "https://github.com/patelnav/flux-container-create#readme"
}

0 comments on commit 9d2eba9

Please sign in to comment.