Skip to content

Update real world example to remove ES7 #466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from Aug 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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