Skip to content

Commit fd29911

Browse files
author
Jacob Klapwijk
committed
feat: add offline/online events
1 parent 9f363af commit fd29911

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/__tests__/events.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ const eventTypes = [
7676
events: ['load', 'error'],
7777
elementType: 'img',
7878
},
79+
{
80+
type: '',
81+
events: ['offline', 'online'],
82+
elementType: 'window',
83+
},
7984
{
8085
type: '',
8186
events: ['load', 'error'],

src/event-map.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,15 @@ export const eventMap = {
363363
EventType: 'PopStateEvent',
364364
defaultInit: {bubbles: true, cancelable: false},
365365
},
366+
// window events
367+
offline: {
368+
EventType: 'Event',
369+
defaultInit: {bubbles: false, cancelable: false},
370+
},
371+
online: {
372+
EventType: 'Event',
373+
defaultInit: {bubbles: false, cancelable: false},
374+
},
366375
}
367376

368377
export const eventAliasMap = {

0 commit comments

Comments
 (0)