Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: delay when < 1, simplify object passing #129

Merged
merged 3 commits into from
May 8, 2024

Conversation

bvandercar-vt
Copy link
Contributor

No description provided.

@@ -82,8 +82,10 @@ export interface GhostCursor {
}

// Helper function to wait a specified number of milliseconds
const delay = async (ms: number): Promise<void> =>
const delay = async (ms: number): Promise<void> => {
if (ms < 1) return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to setTimeout docs, if ms < 1, it uses 1. So we don't want to use setTimeout if 0 is passed here.

await tracePath(path(previous, rand, {
moveSpeed: options?.moveSpeed
}), true)
await tracePath(path(previous, rand, options), true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simplify passing options

@Niek
Copy link
Collaborator

Niek commented May 8, 2024

Great cleanups! Merging now.

@Niek Niek merged commit 6f09e31 into Xetera:master May 8, 2024
1 check passed
@bvandercar-vt bvandercar-vt deleted the style/delay-less-1 branch May 13, 2024 17:26
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.

2 participants