Skip to content

Instantly share code, notes, and snippets.

View NoahSun's full-sized avatar
💫

NoahSun

💫
  • 成都,中国
View GitHub Profile
// This is an example of how to fetch external data in response to updated props,
// If you are using an async mechanism that does not support cancellation (e.g. a Promise).
class ExampleComponent extends React.Component {
_currentId = null;
state = {
externalData: null
};
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.bootcss.com/angular.js/1.5.7/angular.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body ng-app="app">