Add m.redraw() support for multiple mount points

To better match `0.2.x` behavior: https://jsfiddle.net/xbpyqL9k/
This commit is contained in:
Pat Cavit 2016-05-20 15:27:17 -07:00
parent 058b25002d
commit 71c77ba603
8 changed files with 97 additions and 30 deletions

View file

@ -3,7 +3,7 @@
var createRenderer = require("../render/render")
var throttle = require("../api/throttle")
module.exports = function($window, redraw) {
module.exports = function($window, renderers) {
var renderer = createRenderer($window)
return function(root, component) {
var run = throttle(function() {
@ -12,7 +12,7 @@ module.exports = function($window, redraw) {
renderer.setEventCallback(run)
redraw.run = run
renderers.push(run)
run()
}
}