Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Remove unused EVENT.TYPE declaration and unused eventType context value #257

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/EventsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,10 @@ const EventRow: React.FC<{ event: SimEvent }> = ({ event }) => {

const newEventModel = createModel(
{
eventType: '',
eventString: `{\n\t"type": ""\n}`,
},
{
events: {
'EVENT.TYPE': (value: string) => ({ value }),
'EVENT.PAYLOAD': (value: string) => ({ value }),
'EVENT.SEND': () => ({}),
'EVENT.RESET': () => ({}),
Expand Down Expand Up @@ -381,10 +379,7 @@ const NewEvent: React.FC<{
actions: {
sendEvent: (ctx) => {
try {
const scxmlEvent = toSCXMLEvent({
type: ctx.eventType,
...JSON.parse(ctx.eventString),
});
const scxmlEvent = toSCXMLEvent(JSON.parse(ctx.eventString));

onSend(scxmlEvent);
} catch (e) {
Expand Down