Skip to content

Commit

Permalink
Extend event by definePropertes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Mineev committed Jan 27, 2020
1 parent 854fadc commit 4b232ee
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/MountRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,16 @@ export default class MountRenderer implements AbstractMountRenderer {
composed: args.composed,
cancelable: args.cancelable,
});
Object.assign(event, args);

const props = Object.entries(args).reduce(
(accum, [key, value]) => ({
...accum,
[key]: { value },
}),
{}
);

Object.defineProperties(event, props);

act(() => {
node.instance.dispatchEvent(event);
Expand Down

0 comments on commit 4b232ee

Please sign in to comment.