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

Refactored to use XState typegen #341

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

mattpocock
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jan 26, 2022

⚠️ No Changeset found

Latest commit: 24471ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 26, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/statelyai/xstate-viz/DGqQ4WaJU9dBL1UB45CxiQhMgac1
✅ Preview: https://xstate-viz-git-matt-refactored-to-use-xstate-typegen-statelyai.vercel.app

@@ -149,27 +152,22 @@ export const dragSessionTracker = dragSessionModel.createMachine(
return ctx.session;
},
}),
clearSessionData: assign({
clearSessionData: assign((ctx) => ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, this might be worth investigating - ideally this unused argument/function shouldn't be needed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw. the event here is typed as never but that is incorrect - this action is an exit action used in the active state and this should be able to receive at least DRAG_SESSION_STOPPED

setPositionAfterSourceChanged: 'SOURCE_CHANGED';
assignZoomAfterFitToContent: 'FIT_TO_CONTENT';
assignViewBoxAfterFitToContent: 'FIT_TO_CONTENT';
persistPositionToLocalStorage: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is definitely wrong, cause like we've discussed - this should always be a union of string literals (or a single string literal)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this would be different if I did it with the extension now

@@ -49,6 +49,7 @@ const dragModel = createModel(

const dragMachine = dragModel.createMachine(
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -49,6 +49,7 @@ const dragModel = createModel(

const dragMachine = dragModel.createMachine(
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -107,6 +114,14 @@ const editorPanelModel = createModel(

const editorPanelMachine = editorPanelModel.createMachine(
{

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants