This file contains 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
/* | |
`app.use(bodyParser.json())` | |
`Content-Type=application/json` | |
BodyParser will parses json data correctly | |
And cleanup() from raw-body, a dependency of body-parser will clean-up the raw data | |
*/ | |
function cleanup() { | |
received = bufer = null | |
stream.removeListener('data', onData) |
This file contains 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
/* | |
Leverage New Features of React 16 | |
Lesson 1: Error Handling using Error Boundaries in React 16 | |
*/ | |
import React, { Component } from 'react'; | |
import sendToErrorReporting from './sendToErrorReporting'; | |
// Reusable ErrorBoundary component |
This file contains 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
const { render } = window.ReactDOM; | |
const { Component } = window.React; | |
class App extends Component { | |
constructor() { | |
super(); | |
this.state = { data: null, } | |
} | |
componentWillMount() { | |
this.getData(); |
NewerOlder