Reactive Programming from Scratch (JavaScript) - Ep3
Вставка
- Опубліковано 7 гру 2018
- Let's build a reactive JavaScript library, inspired by RxJS, from scratch.
⭐️ Support the channel on Patreon:
/ christopherokhravi
► Playlist:
• Reactivity from Scratch
We need the next the next: {}, of this series 😂 great content
This is a great idea for learning how reactive frameworks work and getting better at using them 👍
Thanks. I’m glad to hear :)
For someone who wasn't overly familiar with RxJS, your pipe implementation seems to be spot on!!
const ob = new Observable(
subscriber => {
subscriber.next(5)
subscriber.next(10)
subscriber.next(-8)
}
)
const transforms = ob.pipe(
map(x => x * 2),
map(Math.abs),
map(x => x + 10),
map(x => `Number is ${x}`)
)
transforms.subscribe(console.log)
// Number is 20
// Number is 30
// Number is 26
Is there any chance we could have another episode of "Reactive Programming from Scratch"?
Thank you very much for this great series that builds rxjs-like API from zero! I'll recommend your channel to all of my friends.
I wrote my fromEvent function like this:
fromEvent: (element, type) => {
const o = new Observable()
element.addEventListener(type, o.emit.bind(o))
return o
},
PS: The ramda-series is awesome too, thanks a lot!
If a logger could be attached to a human brain with logging level set to "extremely verbose", this video would be the result! Kudos for great work! ;)
🤣🤣🤣
Thank you so much for this short course, It help me a lot to understand more in deep Rx Programming! thanks again!
I recommend your playlist to anyone who wants to learn reactive programming. You explain in a way that is easy to grasp.
BTW, did you cancel the next one?
Will you be doing a part 4 of this series?
Can we also have a mini-series on functional programming in JS without using any libraries? I loved the ramda one, but I think I should take a step back and first get comfortable with functional programming in JS.
Excellent idea! I could probably do that :) Meanwhile I could recommend my video on building Snake using FP JS. Thanks a lot for the suggestion and for watching :)
@@JohnSourvinos Hahahha
I think pipe could be implemented recursively like this:
pipe (...os) {
if (os.length == 0) {
return this
}
this.subscribe(x => os[0].emit(x))
return os[0].pipe(os.slice(1))
}
I made it on the fly so I'm not really sure if it is a working solution but I believe it's in the good direction.
Btw brilliant series as always.
Awesome.. Keep up the good work sir :)
come back, we need you!
Thanks for the video -- what colour scheme are you using? 🤔
you can use Object.is(-0, +0) // false
It's like a serial from TV, the most interesting will be in next episode 😂😂😂
Hehehe. Thanks for watching :)
And just like your favorite tv show, it is canceled before the last episodes could be made.... :(.
you could make a tagLog function that you can use in the subscribe
the o.emit.bind(o) is the same thing as changing emit to a arrow function
class Mapper {
emit = (x) => {
this.cbs.map(blah)
}
}
Can you do a source code walkthrough of a large open source project ? maybe live contributing also ? e.g. VS code
Cool video! Are you going to keep it up, though?
I’m assuming you’ve got some issues with switching to Linux since it’s a week since last video was published :)
Your assumption is entirely accurate! :)
Christopher Okhravi so wish you good luck with this and waiting for new videos!