function *nextSiblings(e) { for (let c = e; c!=null; c=c.nextSibling) yield c; }
function *takeWhile(p, xs) { for (let x of xs) if (p(x)) { yield x; } else break; }
class SaveIterator {
constructor(gen) {
this.gen = gen;
this.res0 = gen.next();
this.lastItem = this.res0.value;
}
*iterator() {
if (this.res0.done) return;
yield this.lastItem;
for (let item of this.gen) {
this.lastItem = item;
yield item;
}
this.lastItem = undefined;
this.res0.done = true; //no next
}
[Symbol.iterator] = this.iterator;
} #JavaScriptForwarded from duangsuse::Echo (duangsuse)
duangsues.is_a? SaltedFish
//Events, no forwarding indeed ee.main=()=>html( wOp({msg(ev) {ee.say(ev.text)} }) Inner({}) ) ee.Inner=({it})=>( wOp(it.super={msg:1 }), btn(sayHello=>{ it.super.msg({text:'morning!'}) }) ) ee.main=({d,time})=>( Eq.at([d,time], [1..s.rate], ([t])=>[new…
https://www.youtube.com/watch?v=MnpuK0MK4yo
ee.main=({count=0}, txt,
_=()=>txt.as(x=>x*2) (x=>doc.title=x)
)=>
button(
wOp({tap:count(x=>x+1)}),
txt=html`count is ${count}`,
when(count.as(x=>x%2), p(`even`),p(`odd`) ),
when(count.as(x=>[x>1000, x>500, $Y]),
[p(`big`),p(`medium`), mark(`small`)])
)
ee.Tops=({items=is.w`foo bar baz`})=>
as(items, x=>
p(x.name)
,a=>html())
ee.Await=({}, num=Promise.resolve(10))=>
Reload(F5=>
as({F5,load:num}, x=>
p(html`It is ${num}!`))
,{
load:div(`Loading..`), err:ex=>ErrPage(ex)
})
ee.Navbar=({},es)=>
nav(...es)YouTube
React VS Svelte...10 Examples
The ultimate guide to Svelte for React.js Developers with 10 code examples for both JavaScript frameworks. Find out if SvelteKit is better than Next.js...
SvelteKit Course https://fireship.io/courses/sveltekit
Next.js 13 Course https://fireship.io/courses/nextjs…
SvelteKit Course https://fireship.io/courses/sveltekit
Next.js 13 Course https://fireship.io/courses/nextjs…