replit / desktop

Replit Desktop App
114 stars 3 forks source link

Keep lastOpenRepl in memory #106

Closed sergeichestakov closed 1 year ago

sergeichestakov commented 1 year ago

Why

Wanted to optimize this logic a bit. We shouldn't have to read from the store every time the window is focused or the hash changes in the WS for example. Instead, we can keep the lastOpenRepl state in memory as a variable and subscribe to the changes to prevent reading from / writing to the store more than we need to.

Fixes WS-805

What changed

Keep lastOpenRepl in memory

Test plan

lastOpenRepl logic still works as expected

linear[bot] commented 1 year ago
WS-805 More efficient way to check last open Repl

We shouldn't check the store every time the hash changes in the WS, for example, as that may contribute to perceived slowness