benwiley4000 / cassette

📼 A flexible media player component library for React that requires no up-front config
https://benwiley4000.github.io/cassette/styleguide
MIT License
184 stars 28 forks source link

How can context updates be streamlined to cut out extraneous work? #424

Open benwiley4000 opened 5 years ago

benwiley4000 commented 5 years ago

I think that when a data update happens in the PlayerContextProvider we end up running a bunch of update code that doesn't need to happen because all that context is bundled together. This is vague in my head and we need to profile this better, and think about the best way to eliminate all unrelated work when a context data update happens.

Anything that can happen later (asynchronously + after render), should wait. Anything that doesn't need to run at all because it's unrelated, should be skipped.