How to use the react-hot-loader.call function in react-hot-loader

To help you get started, we’ve selected a few react-hot-loader examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Macil / react-hot-transform / index.js View on Github external
}, function(done) {
    var self = this;
    var source = pieces.join('');
    var inputMapCV = convert.fromSource(source);
    var inputMap;
    if (inputMapCV) {
      inputMap = inputMapCV.toObject();
      source = convert.removeComments(source);
    }
    reactHotLoader.call({
      resourcePath: file,
      callback: function(err, source, map) {
        if (err) {
          done(err);
        } else {
          if (map) {
            source = source + '\n' + convert.fromJSON(map).toComment();
          }
          self.push(source);
          done();
        }
      }
    }, source, inputMap);
  });
};