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
| loadPolyfills() | |
| .then(() => /* Render React application now that your Polyfills are ready */) | |
| /** | |
| * Do feature detection, to figure out which polyfills needs to be imported. | |
| **/ | |
| function loadPolyfills() { | |
| const polyfills = [] | |
| if (!supportsIntersectionObserver()) { |
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
| type Readonly<T> = { | |
| readonly [P in keyof T]: T[P]; | |
| } | |
| type Partial<T> = { | |
| [P in keyof T]?: T[P]; | |
| } | |
| type Nullable<T> = { | |
| [P in keyof T]: T[P] | null; |
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
| class Refs extends React.PureComponent<IProps> { | |
| private references: React.ReactInstance[] = [] | |
| componentDidMount () { | |
| console.log('references', this.references) | |
| } | |
| setRef = (ref: React.ReactInstance) => { | |
| this.references.push(ref) | |
| } |
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
| const { CreateView, CreateComponent } = Buz | |
| const data = { | |
| account: { | |
| userId: 000001, | |
| username: 'Bob', | |
| email: 'Bob@', | |
| avatar: 'https://avatars.com/a-handsome-man', | |
| isLogin: true, | |
| services: ['calendar', 'mailbox', 'game-center'] |
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
| const codeMessage = { | |
| 200: '服务器成功返回请求的数据', | |
| 201: '新建或修改数据成功。', | |
| 202: '一个请求已经进入后台排队(异步任务)', | |
| 204: '删除数据成功。', | |
| 400: '发出的请求有错误,服务器没有进行新建或修改数据,的操作。', | |
| 401: '用户没有权限(令牌、用户名、密码错误)。', | |
| 403: '用户得到授权,但是访问是被禁止的。', | |
| 404: '发出的请求针对的是不存在的记录,服务器没有进行操作', | |
| 406: '请求的格式不可得。', |
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
| %YAML 1.2 | |
| --- | |
| name: HTML | |
| file_extensions: | |
| - html | |
| - htm | |
| - shtml | |
| - xhtml | |
| - inc | |
| - tmpl |
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
| {"lastUpload":"2017-08-20T13:05:44.793Z","extensionVersion":"v2.8.3"} |
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
| var isArrayLike = function (arg) { | |
| return arg && typeof arg.length === 'number' && arg.length > -1 && arg.length % 1 === 0 && typeof arg !== 'function' | |
| } | |
| var filter = (function () { | |
| if (Array.prototype.filter) { | |
| return function (arrayLikeList, filter, thisArg) { | |
| return Array.prototype.filter.call(arrayLikeList, filter, thisArg) | |
| } | |
| } else { // Array.prototype.filter fallback |
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
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |