Skip to content

Instantly share code, notes, and snippets.

@FagnerMartinsBrack
Last active February 15, 2018 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FagnerMartinsBrack/e996f7937f18d7f5cfc6b2936f9b77cc to your computer and use it in GitHub Desktop.
Save FagnerMartinsBrack/e996f7937f18d7f5cfc6b2936f9b77cc to your computer and use it in GitHub Desktop.
(Medium) Front-End Separation
//=============================
// THE API BACK-END PROJECT
//=============================
+ // Internal code inside the Server:
+ // const fullName = 'John Doe';
+ // ...
+ // sendResponse({ header: fullName, ... });
- // GET /user-details
+ // GET /todo-list-page
- const userDetailsParsedResponseBody = {
+ const todoListPageResponseBody {
+ header: 'John Doe',
+ ...
};
// ...
//=============================
// THE CLIENT FRONT-END PROJECT
//=============================
// ...
render() {
- const userDetails = this.props.userDetails;
+ const todoListPage = this.props.todoListPage;
return <section>
- <h1>{userDetails.fullName}</h1>
+ <h1>{todoListPage.header}</h1>
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment