Тёмный

Unidirectional Data Flow 

Curran Kelleher
Подписаться 21 тыс.
Просмотров 1,2 тыс.
50% 1

vizhub.com/curran/6359281c283...
Build complex interactive systems!
Covers: Surgical DOM updates, State management, Idempotent rendering, Unidirectional data flow, Refactoring, ES modules, Destructuring, Implicit return, Method chaining

Опубликовано:

 

22 фев 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@DapperDash
@DapperDash Год назад
Big fan Curran. Thank you for sharing your knowledge. Much appreciated.
@r.spandl
@r.spandl Год назад
`.data([null]).join('svg')` I learned about this one. This will replace some ugly checks in my code. Thanks!
@currankelleher
@currankelleher Год назад
Wonderful! I'm thrilled to hear this.
@user-lp6dh8qv5e
@user-lp6dh8qv5e Год назад
Always great lecture. Thank you.
@currankelleher
@currankelleher Год назад
Thank you!
@javifontalva7752
@javifontalva7752 6 месяцев назад
Thank you so much!!
@forenzik
@forenzik Год назад
Great video!
@hrtmtbrng5968
@hrtmtbrng5968 3 месяца назад
I would pass state as an argument to render. The function should not just conquer the global variable without asking. Otherwise you have no benefit of all this exercise. You are still not in control of the state. When you pass the state to the render function, you would also not need hoisting, which in my opinion makes the code a bit unreadable. I would rename the global setState function to setStateAndRender but the function argument of viz not. That makes the two abstraction levels that you have more clear and visible.
@currankelleher
@currankelleher 3 месяца назад
Thanks for this feedback! I'm happy that you appreciate the ideas behind the patterns here.
@hrtmtbrng5968
@hrtmtbrng5968 3 месяца назад
In my opinion this example is not so good. You blindly implement what you know from React without thinking if this is appropriate or not. This structure makes only sense when your event and your effect are far away from each others. You should choose this structure in order to reduce the sphaghetti-ness of the code, which pulls strings criss cross through your project. But in the example you don't have this. You create it. Your first solution even had the opposite of this. It is the principle of locality. You had the definition of the svg and right there you have defined the handler on it and right there you have defined the effect and right there you have the thing the effect is about. That is already perfect. And you also said, in this case it is not bad. But then the example is just bad for what you try to explain. I know, there are other good reasons why your solution is actually better, and I don't question this. But I don't think, persons who watch this video, actually understand them or that they learn the basic idea behind this. You just said at 5:13 "I would like to introduce a pattern here." For the audience it may look very uninspired. You just apply this pattern, because you learnt it from a text book or because this is how React does it. And now you pull it out of the hat and confront the audience with it. But anyway, the vidoe is very good! Thanks a lot!
@currankelleher
@currankelleher 3 месяца назад
This is great feedback, thank you so much! You are probably right that I introduce the pattern too early, before the need for it becomes clear. I think I need to follow the teaching principle of "Just in Time not Just In Case", because you're correct that the pattern does not provide any clear benefit with such a small example. Perhaps it's best to wait until the examples get more complex, with more "moving parts" regarding tracking state (such as with multiple linked views), and only then introduce this pattern, so that its benefits are more clear. I really appreciate your feedback here, thank you so much!
Далее
Q & A on Unidirectional Data Flow
7:04
Просмотров 226
Using Packages in VizHub
4:22
Просмотров 67
Копия iPhone с WildBerries
01:00
Просмотров 4,4 млн
the TRUTH about C++ (is it worth your time?)
3:17
Просмотров 648 тыс.
The Story of Next.js
12:13
Просмотров 556 тыс.
The Forgotten Lesson about Unidirectional vs MVC
10:14
Просмотров 1,5 тыс.
Антон Гончаров - Unidirectional Data Flow
27:14
Proxies (ES6) - Beau teaches JavaScript
6:34
Просмотров 12 тыс.
Копия iPhone с WildBerries
01:00
Просмотров 4,4 млн