Skip to content

Commit

Permalink
Merge pull request #466 from danmartinez101/use-es6-in-real-world-exa…
Browse files Browse the repository at this point in the history
…mple

Update real world example to remove ES7
  • Loading branch information
gaearon committed Aug 12, 2015
2 parents 6446dfd + 8b5298c commit 889a7be
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
23 changes: 12 additions & 11 deletions examples/real-world/components/Repo.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import React, { PropTypes } from 'react';
import React, { Component, PropTypes } from 'react';
import { Link } from 'react-router';

export default class Repo {
static propTypes = {
repo: PropTypes.shape({
name: PropTypes.string.isRequired,
description: PropTypes.string
}).isRequired,
owner: PropTypes.shape({
login: PropTypes.string.isRequired
}).isRequired
}
export default class Repo extends Component {

render() {
const { repo, owner } = this.props;
Expand All @@ -35,3 +26,13 @@ export default class Repo {
);
}
}

Repo.propTypes = {
repo: PropTypes.shape({
name: PropTypes.string.isRequired,
description: PropTypes.string
}).isRequired,
owner: PropTypes.shape({
login: PropTypes.string.isRequired
}).isRequired
};
7 changes: 4 additions & 3 deletions examples/real-world/middleware/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ function callApi(endpoint, schema) {
const camelizedJson = camelizeKeys(json);
const nextPageUrl = getNextPageUrl(response) || undefined;

return {
...normalize(camelizedJson, schema),
return Object.assign({
{},
normalize(camelizedJson, schema),
nextPageUrl
};
});
});
}

Expand Down

0 comments on commit 889a7be

Please sign in to comment.