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

Error handling in Z.js, alternative to try{}catch(){} block #10

Open
Bona96 opened this issue Nov 9, 2024 · 1 comment
Open

Error handling in Z.js, alternative to try{}catch(){} block #10

Bona96 opened this issue Nov 9, 2024 · 1 comment

Comments

@Bona96
Copy link

Bona96 commented Nov 9, 2024

Borrowing from the idea of unwrap in jquery, and an infamous idea of using an assignment operator ie

const [error, data] ?= await doSomething();

i suggest we use this concept in z.js, introduce that assignment operator inform of a helper function or use a transpiler like for typescript. As we await the TC39 update on this in ECMA, which might never happen but fingers crossed.

This will create easy to read and organized code.

@MalaikaEdward
Copy link

👌 wow

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

No branches or pull requests

2 participants