小编Jba*_*get的帖子

源地图不与Webpack一起使用

我是webpack的新手,在配置它以生成必要的源映射时遇到了一些麻烦.在devtools它说

检测到源地图

但它显示了捆绑而不是原始代码:

截屏2016-06-20于18 04 05

这是我的webpack.config.js:

module.exports = {
  entry: [
    'webpack-dev-server/client?http://localhost:8080/',
    'webpack/hot/dev-server',
    "./src/index.js"
  ],
  output: {
    filename: 'bundle.js',
    path: '/',
  },
  debug: true,
  devtool: 'source-map',
  resolve: {
    extensions: ['', '.jsx', '.scss', '.js', '.json']
  },
  module: {
    loaders: [
      {
        test: /(\.js|\.jsx)$/,
        exclude: /node_modules/,
        loaders: ['react-hot','babel']
      },
      {
        test: /\.scss$/,
        exclude: /node_modules/,
        loaders: ["style", "css?sourceMap", "sass?sourceMap"]
      }
    ]
  },
  devServer: { hot: true },
  plugins: [ new webpack.HotModuleReplacementPlugin() ],
  inline: true,
  progress: true,
  colors: true
};
Run Code Online (Sandbox Code Playgroud)

这是我的package.json:

{
  "name": "react-template",
  "version": "1.0.0", …
Run Code Online (Sandbox Code Playgroud)

google-chrome-devtools source-maps webpack babeljs

23
推荐指数
2
解决办法
1万
查看次数

RxJs Observables:在一些更多的异步请求之后运行重试

我的用例是:

  1. 用户从我们的API请求资产因JWT过期而失败(作为httpOnly cookie传递) - API返回401状态代码.
  2. 我们再次使用refresh_token来验证它们(无需用户做任何事情),以便从我们的客户端请求auth0来检索新的JWT.
  3. 我们将新的JWT发送到我们的API,将其设置为httpOnly cookie以替换过期的cookie.
  4. 然后,我们想要重试用户在步骤1中对API所做的原始请求.

我正在尝试使用redux-observable在我的Redux应用程序中使用Observable .如果你能想到让上述用户流程工作的另一种方式,我很乐意听到.

NB.我正在使用rxjs V5

export const fetchAssetListEpic = (action$, store) => {
  return action$.ofType('FETCH_ASSET_LIST')
  .switchMap( action => {
    const options = {
      crossDomain: true,
      withCredentials: true,
      url: uriGenerator('assetList', action.payload)
    };
    return ajax(options);
  })
  .map(fetchAssetListSuccess)
  .retryWhen(handleError)
  .catch(redirectToSignIn);
};

function handleError(err) {
  return (err.status === 401) ? 
  /* Authenticate here [Step 2] */
  /* Send new JWT to API [Step 3] */
  /* If successful make original request again [Step …
Run Code Online (Sandbox Code Playgroud)

javascript rxjs redux angular2-observables

8
推荐指数
1
解决办法
1720
查看次数