Skip to content

Refactor error handling for emit function in example from README#5

Merged
ivklgn merged 1 commit intoivklgn:mainfrom
AlexMubarakshin:main
Nov 8, 2024
Merged

Refactor error handling for emit function in example from README#5
ivklgn merged 1 commit intoivklgn:mainfrom
AlexMubarakshin:main

Conversation

@AlexMubarakshin
Copy link
Contributor

This PR refines the error handling approach in the README's usage example by replacing direct type casting with a type guard (isConwayError).

Previously, (error as IConwayError).emit(error) was used, but this change now checks for a ConwayError type using if (isConwayError(error)) { error.emit(error); }.

This modification enhances type safety and improves readability for consumers of the library.

@ivklgn ivklgn merged commit 594380c into ivklgn:main Nov 8, 2024
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