@@ -1083,16 +1083,14 @@ var setAttr = (vnode, element, mask, key, old, attrs) => {
1083
1083
// 4. The event name is remapped to the handler before calling it.
1084
1084
// 5. In function-based event handlers, `ev.currentTarget === this`. We replicate that below.
1085
1085
// 6. In function-based event handlers, `return false` prevents the default action and stops event
1086
- // propagation. Instead of that, we hijack it to control implicit redrawing, and let users
1087
- // return a promise that resolves to it.
1086
+ // propagation. Instead of that, we hijack the return value, so we can have it auto-redraw if
1087
+ // the user returns `"skip-redraw"` or a promise that resolves to it.
1088
1088
class EventDict extends Map {
1089
1089
async handleEvent ( ev ) {
1090
1090
invokeRedrawable ( this . _ , this . get ( `on${ ev . type } ` ) , ev . currentTarget , ev )
1091
1091
}
1092
1092
}
1093
1093
1094
- //event
1095
-
1096
1094
var currentlyRendering = [ ]
1097
1095
1098
1096
m . render = ( dom , vnode , { redraw, removeOnThrow} = { } ) => {
@@ -1175,9 +1173,8 @@ m.mount = (root, view) => {
1175
1173
}
1176
1174
}
1177
1175
var redraw = ( ) => { if ( ! id ) id = window . requestAnimationFrame ( redraw . sync ) }
1178
- var Mount = function ( _ , old ) {
1179
- return [ m . remove ( unschedule ) , view . call ( this , ! old ) ]
1180
- }
1176
+ // Cheating with context access for a minor bundle size win.
1177
+ var Mount = ( _ , old ) => [ m . remove ( unschedule ) , view . call ( currentContext , ! old ) ]
1181
1178
redraw . sync = ( ) => {
1182
1179
unschedule ( )
1183
1180
m . render ( root , m ( Mount ) , { redraw} )
0 commit comments