refactor: zero duplicate queries#483
Conversation
|
This branch is behind commaai/master. The line count diff bot is disabled. |
deployed preview: https://483.connect-d5y.pages.devWelcome to connect! Make sure to:
Mobile
Desktop
|
4dec73a to
62876a6
Compare
|
Doesn't seem to load yet |
|
its very broken rn, give me a few |
|
loads now but it's way more buggy the edge case is when the user loads a route directly. hacking the fallback to state is not working consistently. not to mention it's disgusting |
|
i'll play with this idea some more later, or anyone's welcome to pull this and play with it locally |
|
man, it absolutely rips though... this is the sort of speed we can expect with no dupe queries |
| export const useAppContext = () => { | ||
| const context = useContext(AppContext) | ||
| if (!context) throw new Error('Could not find an AppContext!') | ||
| return context | ||
| } |
There was a problem hiding this comment.
What does all this get us over global signals like commaai/connect#503?
There was a problem hiding this comment.
flexible usage. you import this wherever you need it without having to pass signals down the component tree
There was a problem hiding this comment.
i left more analysis on your PR
There was a problem hiding this comment.
We can do that with global signals AFAIK too








just a wip; store current metadata in a Context
won't end up merging this, will break it up if we like it