As a small improvement, I'd suggest using streams in MovieService. getMovies instead of promises: it'll be easier to manage requests, especially if two clients (e.g. widgets) are trying to fetch the same data.
And yeah, there are many packages that try to integrate React and Rx, but it's still definitely worth investigating this direction, as I'm sure there are many things yet to be found!
👋 I enjoy programming in JavaScript. My industry experience is in Angular and Ionic Framework. I teach fundamentals of JavaScript and front-end frameworks in Oslo.
P.S. I love hamburgers. 🍔
👋 I enjoy programming in JavaScript. My industry experience is in Angular and Ionic Framework. I teach fundamentals of JavaScript and front-end frameworks in Oslo.
P.S. I love hamburgers. 🍔
Oh regarding the movies being accessed from multiple widgets, I agree, this is an immediate problem I thought of but figured for the experiment i would put that aside for now. It is definitely not well structured in its current state and I will definitely check out using streams
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, nice article!
As a small improvement, I'd suggest using streams in
MovieService. getMovies
instead of promises: it'll be easier to manage requests, especially if two clients (e.g. widgets) are trying to fetch the same data.Also, please check out this article of mine:
Fetching Data in React with RxJS and <$> fragment
Kostia Palchyk for RxJS ・ Aug 4 '20 ・ 5 min read
And yeah, there are many packages that try to integrate React and Rx, but it's still definitely worth investigating this direction, as I'm sure there are many things yet to be found!
GL
Thanks for the comment and
Ah yes! This is exactly what is was playing with last night! Great article by the way!
I’m still fighting the idea of mixing API requests with subscriptions.
For my experiment I want to try and completely separate fetch from the subscriptions.
I’m not even quite sure what I want to do after reading all the amazing comments and links to existing libraries
Keep on exploring and experimenting 👍
Oh regarding the movies being accessed from multiple widgets, I agree, this is an immediate problem I thought of but figured for the experiment i would put that aside for now. It is definitely not well structured in its current state and I will definitely check out using streams