How to lazy load a function! #javascript

preview_player
Показать описание
In this talk, Yoav Ganbar explains How to lazy load a function for streaming in JavaScript!
Рекомендации по теме
Комментарии
Автор

Have I thought about it? Brother I don't know what it means. Does the function have trouble getting out of bed?

kompassorpigo
Автор

What really draws me in to JavaScript is the complexity and obtuseness of the language.

Etcher
Автор

Took me a bit of thinking to understand his point. I feel like it's just a fancy way of explaining dynamic imports.

the-other-sunny
Автор

Bro made a programming 101 explanation as if it is rocket science

baranacikgoz
Автор

I really like the morphing animations. In my opinion it’s a cool way to show the abstraction!

This all comes from the fact that js is evaluated line by line, and large functions with complex/time-intensive operations can cause unexpected delays before the following code is evaluated. With lazy loading, the function is retrieved when needed and not immediately evaluated in runtime during initial execution.

Maybe you have a admin application and want to display the dashboard page to the user (and let’s say in this scenario you have multiple components and one that renders a list of all users, paginated). Without lazy loading, the js for each component must be evaluated before rendering can occur, causing the entire dashboard to ‘freeze’ or not show at all… while the <UserList /> is being evaluated. By lazy loading this ‘expensive’ component, you can show the rest of the dashboard and use (in react) Suspense to show an alternative loader/spinning-wheel while allowing the dashboard to be interactive and viewable.

jareddiscipio
Автор

This was a one liner explanation brother.

phoenix_random
Автор

Once one of my colleague told me that developers find their work easier than rocket science that's when they came up with unnecessary complicative ways of doing things.

tamzidmahmud
Автор

To those that don’t understand - in layman’s terms, lazy creation just means it isn’t created until necessary

HarshPatel-opjn
Автор

JavaScript absolutely killing it again ✌️workarounds for trash performance. Love it

Laflamablanca
Автор

Its almost as if there is a battle to be the most complex engineer

im-a-trailblazer
Автор

To those who dont understand. The main keyword here is: "import"

persas
Автор

I was thinking maybe he's explaining how to *load* functions into memory lazily. My mind went all sorts of ways, somehow importing DLLs or WASM or maybe just downloading the file over the network when the fn is required to execute... Nope. He was just asking how to lazily evaluate a function. That's how functions are always evaluated, at the call site 💀😭

comradepeter
Автор

Yes and no. This is vanilla reactish. Mainly this is just es6 modules

kylemartinez
Автор

What is the benefit of a lazy load function?

umairimran
Автор

I looked in the 1st second and thought that is a mess. Then he rearranged it the right way as if he clever. What is all these terms they now have about lazy loadable, hooks etc.

Dabayare
Автор

What tool did he use to morph the code changes like this?
Would be great in presentations

polaedward
Автор

I feel like these engineers were offended by someone telling them they're not real "engineers" thats why theyre making programming more complicated, partner that with America's obsession to give everyting a term and boom! programmers that dont have english as their first language are overwhelmed by all these terms and complicated explanation which they dont know theyre already doing.

araara
Автор

No u see that actually a nice way to sway away young lads from JS and get then into C

peekknuf
Автор

In Swift? we put the key "lazy" before it and it lazy loadable.
In JS no idea.

casadogaspar
Автор

I think it should be export default for inner.js

gamingwolf
join shbcf.ru