1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-17 05:01:28 +00:00

Something is up

This commit is contained in:
Scott Tolksdorf
2017-01-05 20:49:45 -05:00
parent 537a75b2ab
commit 3dc4c13178
8 changed files with 79 additions and 65 deletions

View File

@@ -13,6 +13,13 @@ const NewPage = require('./pages/newPage/newPage.jsx');
//const ErrorPage = require('./pages/errorPage/errorPage.jsx');
const PrintPage = require('./pages/printPage/printPage.jsx');
const mapObject = (names, obj) => {
return _.reduce(names, (r, name) => {
if(obj[name]) r[name] = obj[name];
return r;
}, {});
};
let Router;
const Homebrew = React.createClass({
getDefaultProps: function() {
@@ -21,7 +28,7 @@ const Homebrew = React.createClass({
version : '0.0.0',
user : undefined,
brew : {},
brew : undefined,
brews : []
};
},
@@ -30,11 +37,9 @@ const Homebrew = React.createClass({
global.account = this.props.account;
global.version = this.props.version;
Actions.init({
version : this.props.version,
brew : this.props.brew,
account : this.props.account
});
console.log(mapObject(['version', 'brew', 'account'], this.props));
Actions.init(mapObject(['version', 'brew', 'account'], this.props));
Router = CreateRouter({