Let's build a polling mechanism

  Рет қаралды 14,668

Steve (Builder.io)

6 ай бұрын

together, live!
#javascript #typescript

Пікірлер: 27
@jordanmanley7758
@jordanmanley7758 6 ай бұрын
These are some of the best programming videos on KZbin right now. Absolutely love it!
@RezaBuilds
@RezaBuilds 6 ай бұрын
You can see the passion in his face! Im hyped up 👏👏👏
@aadityabhusal
@aadityabhusal 6 ай бұрын
I came to know you & BuilderIO a couple years back when I started building low code tools. Its so great to see you create such awesome videos :)
@jasonpraful
@jasonpraful 6 ай бұрын
Mate, absolute joy watching this stream. I absolutely loved how you focused on getting shit done first before cleanup. Also found it crazy how you managed to squeeze in this beautiful stream in the midst of your meetings.
@nicolasdelfino1
@nicolasdelfino1 6 ай бұрын
Great stuff, completely agree on your pragmatic take 👍
@loia5tqd001
@loia5tqd001 6 ай бұрын
This stream is so valuable! Pls keep it up!
@ricko13
@ricko13 6 ай бұрын
Thank you man, I always learn a lot from you 💪
@kmylodarkstar2253
@kmylodarkstar2253 6 ай бұрын
nice to work with design tokens
@JanEwaldable
@JanEwaldable 6 ай бұрын
I like the postPluginMessage utility function setup at 27:00, but I'm a bit confused. Where does the parent variable in the function come from?
@Steve8708
@Steve8708 6 ай бұрын
It’s just a global variable, representing the “parent” window context. All s will have a global parent var representing the parent page, or a top level page the parent === window
@JanEwaldable
@JanEwaldable 6 ай бұрын
@@Steve8708 thanks for the explanation. That's what I thought, but I guess I wanted it to be something fancier😅
@ytPEDROjoao
@ytPEDROjoao 6 ай бұрын
You're nice
@hunterwilhelm
@hunterwilhelm 6 ай бұрын
What are your thoughts about subscribing to a firestore query, which uses web sockets?
@hunterwilhelm
@hunterwilhelm 6 ай бұрын
Polling is still a great solution since it works!
@FaridAdamgrino
@FaridAdamgrino 6 ай бұрын
I was going to sugest sockets as well, but yes polling works.
@anishali6018
@anishali6018 6 ай бұрын
sorry im late
@Draqotr
@Draqotr 6 ай бұрын
Can you not do polling on the window itself with: const authWindow = window.open('url', '_blank', 'popup=yes') Then set an interval that checks if (authWindow.closed) { clearInterval(intervalId) //your logic } I am still at the beginning of the video so you may have mentioned that it does not work, in which case, please ignore 😅
@Draqotr
@Draqotr 6 ай бұрын
If this works (now that I watched the video, it should), you can do a redirect back after authenticating back to your app, change the URL to contains a query parameter with the private key, then adjust your logic in the interval to track previousUrl !== currentUrl then grab the query parameter from the URL. I think after authWindow.closed is true you won't be able to access location in the window thus the timing in MS in the interval should allow to run one more tick before you do window.close()
@Draqotr
@Draqotr 6 ай бұрын
According to MDN seems Opera and Safari do not support the popup param but you can get away by simply opening a new tab without the popup param
@thelazycoder64
@thelazycoder64 6 ай бұрын
Can't you just post a message from a browser window a to browser window b
@Steve8708
@Steve8708 6 ай бұрын
Generally yes, but sadly in a Figma plugin no. In the last stream/vid we tried that and saw that it didn’t work, and then read in their docs they said they don’t allow it
@cas818028
@cas818028 6 ай бұрын
Stop just stop pilling already, Please for the love of got learn about aync, event driven models. Teach people how to fire off, broadcast, publish, an event. Do some long processing in the background THEN push an event/message back the client. There are SOOOOOO many technologies now that enable this. Plenty of managed technologies that make this stupid simple. Just stop with these polling tutorials for the love of god! This is such an antiquated approach that has been around since the 90's
@maxwellcoding
@maxwellcoding 6 ай бұрын
For example, what technologies?
貓咪 小鬼當家🎮🔫🚑 #aicat #shorts #cute
0:41
Cat Cat Cat
Рет қаралды 28 МЛН
Waka waka 🤣 Which video is the best 1,2,3,4? 🤩
0:13
Adani Family
Рет қаралды 7 МЛН