Readplace

(Medium) Front-End Separation

Gist 1 min read
View original
  • current

This article is too short to summarise.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

//=============================
// 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>
// ...