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
| // .npmrc | |
| disturl=https://npm.taobao.org/dist | |
| registry=https://registry.npm.taobao.org | |
| @xxx:registry=http://registry.npm.xxx.com | |
| sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
| phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ | |
| electron_mirror=https://npm.taobao.org/mirrors/electron/ | |
| fse_binary_host_mirror=https://npm.taobao.org/mirrors/fsevents | |
| chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver |
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
| /* | |
| * | |
| * Top View | |
| * | |
| */ | |
| import React, { isValidElement } from 'react'; | |
| import { AppRegistry, DeviceEventEmitter, View } from 'react-native'; | |
| export interface TopViewProps { | |
| children?: React.ReactNode |
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 TArgs = any[]; | |
| type TObjArgs = [object, string | symbol, TypedPropertyDescriptor<any>]; | |
| function log(...args: TArgs | TObjArgs): any { | |
| return isDescriptor(args) | |
| ? decorate(...args) | |
| : (...decoArgs: TObjArgs) => { | |
| const params = [...decoArgs, ...args] as [object, string | symbol, TypedPropertyDescriptor<any>, any]; | |
| decorate(...params); | |
| }; |
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 instanceA = Singleton.getInstance("小王"); | |
| var instanceB = Singleton.getInstance("小张"); | |
| console.log(instanceA === instanceB); | |
| console.log(instanceA.name,instanceB.name); | |
| // 非单例 | |
| var instanceC = new Singleton("小王"); | |
| var instanceD = new Singleton("小张"); |
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
| .flex { | |
| display: -webkit-box; | |
| display: -moz-box; | |
| display: -ms-flexbox; | |
| display: -webkit-flex; | |
| display: flex; | |
| } | |
| .flex.flex--reverse { | |
| -webkit-box-orient: horizontal; |