New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bhaidar/docs/tutorial #4375
Bhaidar/docs/tutorial #4375
Conversation
Generated by 🚫 dangerJS |
Pull Request Test Coverage Report for Build 7697
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all thanks a lot for this pr!
I added a bunch of comments but those are very redundant, hope that helps to find all the occurences.
mostly it's usage of var instead of let or const and using old creation functions, e.g. Observable.fromEvent(...)
was replaced with fromEvent(...)
If there is anything unclear don't hesitate to ask me.
|
||
## Converting to observables | ||
|
||
<!-- skip-example --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the skip-example comments were used by the old docs. Nevertheless it don't have an impact in the new docs, therefore I would remove it
import { Observable } from 'rxjs'; | ||
|
||
// From one or multiple values | ||
const ofObser = Observable.of('foo', 'bar'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you use the static creation operators and the pipable operators in the examples
const ofObser = Observable.of('foo', 'bar'); | ||
|
||
// From array of values | ||
const fromObser = Observable.from([1, 2, 3]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static from please
const fromObser = Observable.from([1, 2, 3]); | ||
|
||
// From an event | ||
const fromEventObser = Observable.fromEvent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static fromEvent
); | ||
|
||
// From a Promise | ||
const fromPromiseObser = Observable.fromPromise(fetch('/users')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fromPromise were deprecated/aliased to from
); | ||
|
||
var decreaseButton = document.querySelector('#decrease'); | ||
var decrease = Observable.fromEvent(decreaseButton, 'click').pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const and static fromEvent
); | ||
|
||
var inputElement = document.querySelector('#input'); | ||
var input = Observable.fromEvent(inputElement, 'keypress').pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const and static fromEvent
); | ||
|
||
// We merge the three state change producing observables | ||
var state = Observable.merge(increase, decrease, input).pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const + staticmerge function
foo: 'bar' | ||
}; | ||
|
||
var state = Observable.merge(someObservable, someOtherObservable).pipe( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const + merge
|
||
Now you can import your state in whatever UI layer you are using. | ||
|
||
<!-- skip-example --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed comment
@bhaidar If you're looking to do this, can you What was in there definitely needs to be updated, but what is in this PR reads more like a personal blog entry, and seems like it's completely different. I REALLY appreciate the time and thought you put into this, but I'm not sure we can merge this one because it loses context and history, and I can't say I agree with every point in it. I really think you should take this material and publish it as a blog, and I'd be happy help you refine it and spread it. The RxJS docs are more for approved practices that come from the core team, and this would require a lot of discussion and refinement. |
Sorry for the confusion on this. This content usdd to be in thd old docs and therefore I thought it needed to be migrated. Are there maybe some bits we could use as starting point for the receipt, we planned to have at some point. I'm really sorry for all the confusion, totally my fault. |
Hi @benlesh @JWO719 I had some issues at first running and updating the docs locally and that explains why most of the changes I've done were lost! In all cases, I've updated once again the docs. As Jan said, those are the tutorials from the old docs. I understood from Jan I need to upgrade to RxJs6. In all cases, I will update the branch and let me know how you would like to proceed. If there are other things to upgrade from old docs please let me know to work on them. Best |
Description:
Migrate old docs/tutorial to the new docs_app/tutorial
Related issue (if exists):