3 ms·
Well, maybe it’s time to push it further for useIf(), useFor(), and generic useFoo = makeUseOf(func|obj) and then invent a new syntax for it, like they did for
by wruza 5y ago
Well, maybe it’s time to push it further for useIf(), useFor(), and generic useFoo = makeUseOf(func|obj) and then invent a new syntax for it, like they did for promises. Because now it feels like these C++ libs that pretend to be high-level languages above the hood and not C++. Something like:
<ul>
async {
return this.data ??= fetch(…)
}
awhile {
<p>Loading</p>
}
catch (error) {
<p>Error loading</p>
}
then (data) {
for (let x of data) {
<li>{x.title}</li>
}
else {
<p>No items</p>
}
</ul>
Does anyone also think that this small-picture-in-picture went too far?