cabal-club / cabal-desktop

Desktop client for Cabal, the p2p/decentralized/local-first chat platform.
https://cabal.chat
GNU Affero General Public License v3.0
843 stars 77 forks source link

write selectors for layout #287

Closed khubo closed 3 years ago

khubo commented 3 years ago

The cabals property in store updates very often - i.e on new message, or even when a user join/leaves etc - and the main layout component directly subscribing to it causes it to re-render on every small change. Moving the required logic into a selector reduces the unwanted re-rendering of the component.

p.s: This perf improvement should be applied across other parts of app too, which I am planning to undertake incrementally ^_^

khubo commented 3 years ago

ideally this should also fix #246

okdistribute commented 3 years ago

awesome @khubo ! this is an often complained about bug.