duangsues.is_a? SaltedFish
60 subscribers
609 photos
6 videos
91 files
562 links
🌶🐔🐟 duangsuse 的日常
尤其喜欢发些奇奇怪怪的东西
和转载别人的东西
Download Telegram
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;
}
#JavaScript
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)