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

loop + iterate examples to reflect new api #496

Open
ethanniser opened this issue Jul 7, 2023 · 0 comments
Open

loop + iterate examples to reflect new api #496

ethanniser opened this issue Jul 7, 2023 · 0 comments

Comments

@ethanniser
Copy link

ethanniser commented Jul 7, 2023

  • iterate and loop have 'moral equivalent' examples that use the names of the old function arguments
  • the loop example should have a return statement at the end similar to iterate
  • they also use one letter variable names. full variable names provide additional clarity (example from docs recently)
  • finally thoughts on renaming the while option to condition or something similar? while being a language keyword breaks syntax highlighting (you can see this in the api page) and prevents this kind of functionality:
const while = (x: number) => x > 5;
// ^ ERROR "'while' is not allowed as a variable declaration name."
Effect.loop(1, { while, ...otherOptions });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant