No video

Finite State Machines in JavaScript

  Рет қаралды 13,646

Steve Griffith - Prof3ssorSt3v3

Steve Griffith - Prof3ssorSt3v3

Күн бұрын

Пікірлер: 33
@pearlsswine
@pearlsswine 4 жыл бұрын
I've read a few articles on this finite state machine and have struggled to get a grasp of it, but your video made it really clear what it is. Thank you!
@perronemirko
@perronemirko 11 ай бұрын
Agree
@jornejongsma
@jornejongsma 2 жыл бұрын
It's Friday night, 11pm and I had a few... And I'm watching this! I really feel addressed by this video: I'm in the third state, so I think I should dispatch myself to another state: SLEEP
@yogesh.asthana
@yogesh.asthana 4 жыл бұрын
Awesome video. Just needed it to know how can I implement state machine. Thank you.
@Matanyo1
@Matanyo1 4 жыл бұрын
Finally, somebody explains the state machine concept well! Thank you! I love your channel! Do you have any website?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
I have no personal website currently. I do plan on launching some courses in the future likely through Udemy.
@agent-33
@agent-33 2 жыл бұрын
Your explanations are always the best.
@mikaknuuttila2052
@mikaknuuttila2052 4 жыл бұрын
This video gave me a great idea for a project at work. Thanks Steve!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Great. I just added a link to another code GIST in the description that has more properties and features.
@mikaknuuttila2052
@mikaknuuttila2052 4 жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 thanks teach!
@pauloheres
@pauloheres 6 ай бұрын
tks! Amazing explanation
@taiiebehmohebi3427
@taiiebehmohebi3427 3 жыл бұрын
Hi Steve, I've used the concept of state machine as you explained, my codes are almost like yours, but when i use arrow functions in my states , the this key word refers to the window object and when i use classical definition of functions the this refers to the transition object inside of machine and i'm not able to use the changestate and dispatch functions that are declared inside machine, i would be grateful i you could help me about that...thanks in advance
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
That is what arrow functions do to `this`. kzbin.info/www/bejne/m4iniZqpfsyHfc0
@MrHedy90
@MrHedy90 3 жыл бұрын
Thank you!
@sydneycamille1932
@sydneycamille1932 11 ай бұрын
Thanks!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 11 ай бұрын
Thank you very much!
@koteswararaonukani1682
@koteswararaonukani1682 4 жыл бұрын
Hi Steve , i am big fan of all of your videos could you please create playlist of Typescript videos thats very helpful for new JS framework learners like me or please suggest good tutorials or blogs out there. Thanks Steve!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
Thanks. Please add your request on my tutorial request video comments.
@6ocram
@6ocram Жыл бұрын
Thank you very much this is really useful :D
@MrMarkgyuro
@MrMarkgyuro 4 жыл бұрын
thank you!
@6365bharath
@6365bharath 4 жыл бұрын
Steve, what are the practical use-cases for Finite State machines on the frontend? Do we use this when there are so many if-else conditions and if our application can only have one state at a time?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 жыл бұрын
React JS and other frameworks are built around managing state. There is a state object on each page. It has an initial state object when the page loads and then you can modify that object anytime you want. Each change to the state will trigger changes to the page and other functionality.
@jimmyclawson3494
@jimmyclawson3494 4 жыл бұрын
Cool man
@glebzaitsev6741
@glebzaitsev6741 3 жыл бұрын
Is there any use of const actions? Looks like this declaration is redundant. Other than that the great video, good job!
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 жыл бұрын
Using const will help you to avoid typos by providing auto-complete and actual error messages. Either strings or Symbols as the values work well.
@glebzaitsev6741
@glebzaitsev6741 3 жыл бұрын
​@@SteveGriffith-Prof3ssorSt3v3 Thanks, i mean a diferent thing tho. I meant declaration of "actions" constant in dispatch function. You can use it declaring "action" in the next row tho, like const action = actions[actionName] which make sense. It is even highlighted as not used as i can see. I had exactly same questions reading this article: www.smashingmagazine.com/2018/01/rise-state-machines/ It wan't very clear. Anyway, again, i really liked your example and it is much clearer and easier to understand than written article.
@RameenFallschirmjager
@RameenFallschirmjager 4 жыл бұрын
Great example!
@leeeric6292
@leeeric6292 Жыл бұрын
is there difference between this.dispatch and dispatchEvent?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 Жыл бұрын
Yes. dispatch is a method inside our State Machine object. dispatchEvent is a method in the Web APIs that allows us to trigger JavaScript Event objects on targets.
@leeeric6292
@leeeric6292 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Thanks for your response and help, since I want to know more this.dispatch, I had search this term all day in Google , but it only give me dispatchEvent, do u know where I can get in the web ? Many Thanks.
@leeeric6292
@leeeric6292 Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 Today I go through this video again, I got what u mean. The function "dispatch" in this video is the name u defined, and the dispatchEvent function is the built API. Thanks.
@DelPieroJoga10
@DelPieroJoga10 4 жыл бұрын
+1 subscribe
@hansschenker
@hansschenker 3 жыл бұрын
It is not sane to test the drunkenState Machine!
Why Should I Use const in JavaScript
9:04
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 9 М.
When Booleans Are Not Enough... State Machines?
21:50
Next Day Video
Рет қаралды 24 М.
Now it’s my turn ! 😂🥹 @danilisboom  #tiktok #elsarca
00:20
Elsa Arca
Рет қаралды 11 МЛН
Glow Stick Secret Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 18 МЛН
No BS TS #29 - Typescript/React - Using xState
22:29
Jack Herrington
Рет қаралды 10 М.
ES6 Iterator & Generator Fundamentals
18:18
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 31 М.
Visually Understanding JavaScript Prototypes
14:58
Steve Griffith - Prof3ssorSt3v3
Рет қаралды 54 М.
everything is open source if you can reverse engineer (try it RIGHT NOW!)
13:56
Low Level Learning
Рет қаралды 1,4 МЛН
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Let's Learn Python #19 - Finite-State Machines (FSM)
22:11
Anchor Rainbow
Рет қаралды 84 М.
C++ State Machines
22:10
Nicholas Day
Рет қаралды 7 М.
Now it’s my turn ! 😂🥹 @danilisboom  #tiktok #elsarca
00:20
Elsa Arca
Рет қаралды 11 МЛН