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
// react-native webview onMessage and postMessage BUG https://github.com/facebook/react-native/issues/10865 | |
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
WebView, | |
ScrollView, |
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
/** | |
* 该方法仅支持IE8以上 | |
* 网络请求方法 | |
* url:请求地址 | |
* options = { | |
* catchs: 异常处理,控制台抛出的异常是否自己处理:true 是,false 否 由公共方法统一处理优化显示给用户 默认 false | |
* credentials: 请求带上cookies,是每次请求保持会话一直 | |
* method: 请求使用的方法,如 GET、POST | |
* headers: 请求的头信息,形式为 Headers 对象或 ByteString。 | |
* body: 请求的 body 信息:可能是一个 Blob、BufferSource、FormData、URLSearchParams 或者 USVString 对象。注意 GET 或 HEAD 方法的请求不能包含 body 信息。 |
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
var webpack = require('webpack') | |
var webpackDevMiddleware = require('webpack-dev-middleware') | |
var webpackHotMiddleware = require('webpack-hot-middleware') | |
var config = require('./webpack.config') | |
var app = new (require('express'))() | |
var port = 3000 | |
var compiler = webpack(config) | |
app.use(webpackDevMiddleware(compiler, { noInfo: true, publicPath: config.output.publicPath })) |
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
/* | |
* Webpack distribution configuration | |
* | |
* This file is set up for serving the distribution version. It will be compiled to dist/ by default | |
*/ | |
'use strict'; | |
var webpack = require('webpack'); |
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
'use strict'; | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
var webpackDistConfig = require('./webpack.dist.config.js'), | |
webpackDevConfig = require('./webpack.config.js'); | |
module.exports = function (grunt) { |
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
// var browserifyES6Transpiler = require('browserify-es6-transpiler'); | |
var babelify = require('babelify'); | |
// fis3 模块化开发支持 | |
fis.config.set('settings.preprocessor.browserify', { | |
browserify: { | |
debug: true, | |
transform: [ | |
[ | |
babelify, |
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
{ | |
"extends": "airbnb", | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, | |
"node": true, | |
"mocha": true | |
}, | |
"rules": { | |
// Disable for __DEV__, __SERVER__ usage. |
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
'use strict'; | |
export default createReducer(initialState, handlers) { | |
return function reducer(state = initialState, action) { | |
if (handlers.hasOwnProperty(action.type)) { | |
return handlers[action.type](state, action); | |
} else { | |
return state; | |
} | |
} |
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
/** | |
* @flow | |
*/ | |
'use strict'; | |
import {StyleSheet, Platform} from 'react-native'; | |
function create(styles: Object): {[name: string]: number} { |