Skip to content

Conversation

@microbit-matt-hillsdon
Copy link
Collaborator

sendRequest isn't an async function as it can synchronously throw errors so we need something to prevent reentrant updates in the error case.

Otherwise though we don't needed it if we move more work into the state.

Alternative take on #1196 that's a bit of a bigger change but perhaps a better split of work between state/view plugin.

sendRequest isn't an async function as it can synchronously throw errors
so we need something to prevent reentrant updates in the error case.

Otherwise though we don't needed it if we move more work into the state.
@github-actions
Copy link

github-actions bot commented Dec 5, 2024

I'm not sure this is necessary but it feels obviously correct /
straightforward which is a win in this code.
},
});

const triggerSignatureHelpRequest = async (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I found this hard to pick up again & understand because this function is called from two very different contexts: a CM command (where it's totally fine / expected to view.dispatch) and and the ViewPlugin update call. Doubtless my doing!

Copy link
Collaborator

@microbit-robert microbit-robert left a comment

Choose a reason for hiding this comment

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

I think this looks good.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit 9947c9a into main Dec 9, 2024
1 check passed
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the cm-view-dispatch branch December 9, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants