Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit e883584

Browse files
committed
Add error context object
1 parent ddb1b54 commit e883584

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ const elmWebComponents = {
6262

6363
class ElmElement extends HTMLElement {
6464
connectedCallback() {
65+
const context = {};
6566
try {
6667
let props = Object.assign({}, getProps(this), staticFlags)
6768
if (Object.keys(props).length === 0) props = undefined
6869

6970
const flags = mapFlags(props)
71+
context.flags = flags;
7072

7173
if (elmVersion === '0.19') {
7274
/* a change in Elm 0.19 means that ElmComponent.init now replaces the node you give it
@@ -89,7 +91,7 @@ const elmWebComponents = {
8991
}
9092
} catch (error) {
9193
console.error(error)
92-
onSetupError(error, flags)
94+
onSetupError(error, context)
9395
}
9496
}
9597

0 commit comments

Comments
 (0)