Комментарии:
Thank you
ОтветитьThanks for your passion and thorough explanations.
I really don't like that transition effect with the three dots, though. It's really jarring.
Great tutorial, thanks for sharing.
ОтветитьYou should have used parcel. Webpack adds a ton of useless boilerplate at the beginning
ОтветитьWhy are you using Typescript if you're going to type everything as any :')
Just to say you write typescript?
Hola,
Callbacks, Promesas y Observables son lo mismo...????🤔🤔
Agradecería tu respuesta
My browser says that the certificate for the website of any of the links expired 91 days ago. Am I the only one?
ОтветитьIf any of you, like me, had problems understanding the difference between hot and cold observables, here an analogy i found online....
"Hot and cold observables:
There are two types of observables: hot and cold. The main difference is that a cold observable creates a data producer for each subscriber, whereas a hot observable creates a data producer first, and each subscriber gets the data from one producer, starting from the moment of subscription.
Let’s compare watching a movie on Netflix to going into a movie theater. Think of yourself as an observer. Anyone who decides to watch Mission: Impossible on Netflix will get the entire movie, regardless of when they hit the play button. Netflix creates a new producer to stream a movie just for you. This is a cold observable.
If you go to a movie theater and the showtime is 4 p.m., the producer is created at 4 p.m., and the streaming begins. If some people (subscribers) are late to the show, they miss the beginning of the movie and can only watch it starting from the moment of arrival. This is a hot observable.
A cold observable starts producing data when some code invokes a subscribe() function on it. For example, your app may declare an observable providing a URL on the server to get certain products. The request will be made only when you subscribe to it. If another script makes the same request to the server, it’ll get the same set of data.
A hot observable produces data even if no subscribers are interested in the data. For example, an accelerometer in your smartphone produces data about the position of your device, even if no app subscribes to this data. A server can produce the latest stock prices even if no user is interested in this stock."
Thank you!. You can run yarn commands without run keyword btw.
ОтветитьRead this if you're getting 404 once you hit your localhost server:
1 - Change the "start" script to: "webpack serve --mode=development"
2 - Create a new folder on the project's root folder: /public (mkdir public)
3 - Move your index.html file to /public
4 - Add this to you webpack.config.js > output:
publicPath: '/',
It should look like this:
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
publicPath: '/',
}
Hope it helps =)
Excellent tutorial
ОтветитьThank you! I watched the whole video. Pro-tip: It helps to read through the docs first, and then come back here, where the video helps put it together.
Ответить"I should warn you. There are multiple ways to create an Observable." 😆
ОтветитьSorry but this tutorial is obsolete. Wasted an hour of my time trying to get it to work.
ОтветитьThanks, Gary. you are awesome!
ОтветитьThis was done a few years back so likely things changed quite a bit for some of the rxjs stuff. I hit some errors, but the latest version (as of today lol), I can get my code.ts to compile if I just use the latest example in the readme of rxjs which states:
It's recommended to pull in the Observable creation methods you need directly from `'rxjs'` as shown below with `range`. And you can pull in any operator you need from one spot, under `'rxjs/operators'`.
import { range } from "rxjs";
import { map, filter } from "rxjs/operators";
range(1, 200)
.pipe(
filter(x => x % 2 === 1),
map(x => x + x)
)
.subscribe(x => console.log(x));
Hope it helps
Thank you!! First time I understood rxjs if during your video ))
ОтветитьCrisp and clear
ОтветитьExcellent crash course into RxJS - is exactly what it says it is!
ОтветитьThanks!
ОтветитьSuper video! I applauded for SEK 50.00 👏👏
ОтветитьSo a cold observable is like a "many-to-many" relationship, where each time an observable subscribes to the observable, the observable creates a new "stream" of data for the observer, and a hot observable is like a "one-to-many" relationship, where each time the observable subscribes to the observable, the observable references or uses the same producer of the data set for each observable that subscribes to it. Is that correct?
ОтветитьThanks for the course, is there an updated version of this? I try to follow but seems a lot of the stuff is obsolete.
ОтветитьHot and cold observables
There are two types of observables: hot and cold. The main difference is that a cold observable creates a data producer for each subscriber, whereas a hot observable creates a data producer first, and each subscriber gets the data from one producer, starting from the moment of subscription.
Let’s compare watching a movie on Netflix to going into a movie theater. Think of yourself as an observer. Anyone who decides to watch Mission: Impossible on Netflix will get the entire movie, regardless of when they hit the play button. Netflix creates a new producer to stream a movie just for you. This is a cold observable.
If you go to a movie theater and the showtime is 4 p.m., the producer is created at 4 p.m., and the streaming begins. If some people (subscribers) are late to the show, they miss the beginning of the movie and can only watch it starting from the moment of arrival. This is a hot observable.
A cold observable starts producing data when some code invokes a subscribe() function on it. For example, your app may declare an observable providing a URL on the server to get certain products. The request will be made only when you subscribe to it. If another script makes the same request to the server, it’ll get the same set of data.
A hot observable produces data even if no subscribers are interested in the data. For example, an accelerometer in your smartphone produces data about the position of your device, even if no app subscribes to this data. A server can produce the latest stock prices even if no user is interested in this stock.
Has someone else had this problem? No inputs were found in config file '/home/samuka/Área de Trabalho/rxjs-learn/tsconfig.json'. Specified 'include' paths were '["src"]' and 'exclude' paths were '["./dist/"]'.
ОтветитьFor anyone having trouble getting the start script to work, use this instead:
webpack serve
With webpack cli v4, you have built in support for the dev server. You could also install v3 of the cli if you want
thanks!
ОтветитьNice course but Why u directly jumped into coding without briefing.
ОтветитьReally enjoyed the learning. Thought Rxjs as some rocket science until I landed to your video...!! Thanks
Ответитьthe observer often refers to the input of subscribe function. While observable.subscribe returns a subscription. So naming observer = observable.subscribe may cause newbies misunderstand.
ОтветитьA great tutorial, thanks for creating this tutorial. I am learning Angular at this time and I see the most common RxJs function to be used is pipe. I hoped you would cover it, but it was excellent learning anyway. thanks again.
ОтветитьThe first ten mins or so of this otherwise great tutorial should be cut.
ОтветитьIf you guys have problems with webpack do this "start": "webpack serve --mode development" and npm install --save rxjs-compat at least these two problems I had to solve.
ОтветитьI appreciate this depth knowledge, and also I think, new video is needed as rxjs v6 has a lot of changes and it's 2021.
Ответитьwhat you don't create observer.next(), observer.error(?), observer.complete() like this and then you using try catch yeah i think try catch not woking because in try has no faults
ОтветитьThe best observable explanation I found so far
ОтветитьAwesome, Gary! Thanks!!
Ответитьgood stuff Gary.
Ответить2020 udpate: you may face errors if you following this tutorial in 2020-Dec. and after, here is some i faced and fixed
1) " Error: Cannot find module 'webpack-cli/bin/config-yargs'"
use "start": "webpack serve" instead of "start": "webpack-dev-server --mode-development"
2) Module not found: Error: Can't resolve 'rxjs/Observable'
use import * as Rx from "rxjs";
then access observable from Rx.observable
console.log('RX', Rx.observable);
rxjs is unnecessary especially in JS world
ОтветитьCant run project maybe u need to update packages its not working
ОтветитьGood stuff.
However, I'm a bit confused about BehaviourSubject. Why do we even have it? It seems to be the same as ReplaySubject with one argument - 1.
I am running into code: 'MODULE_NOT_FOUND',
requireStack: [
learn_rxjs/node_modules/webpack-dev-server/bin/webpack-dev-server.js'
issue.
This is my package.json
{
"name": "learn_rxjs",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "webpack-dev-server --mode development"
},
"dependencies": {
"rxjs": "^6.6.3",
"ts-loader": "^8.0.7",
"typescript": "^4.0.5",
"webpack": "^5.3.2",
"webpack-dev-server": "^3.11.0"
},
"devDependencies": {
"webpack-cli": "^4.1.0"
}
}
If anyone gets `Cannot find module 'webpack-cli/bin/config-yargs'` maybe try using an older version of the webpack-cli (apparently version 4+ doesn't play nice with the webpack-dev-server)
ОтветитьChanging back and forth from the code to your face for 2 seconds to explain a concept is very disturbing
ОтветитьWhen was this recorded? Definitely not 2018, we had let and const back then
Ответить