io
io copied to clipboard
loop + iterate examples to reflect new api
- 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
whileoption toconditionor something similar?whilebeing 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 });