status-im / status-desktop

Status Desktop client made in Nim & QML
https://status.app
Mozilla Public License 2.0
265 stars 76 forks source link

Make stores typed and disambiguated by prefixes if needed #14801

Open micieslak opened 2 weeks ago

micieslak commented 2 weeks ago

Description

Screenshot from 2024-05-15 23-25-15

Search for property var .*Store gives long list of occurrences where stores are not typed. It makes the code more difficult to read and navigate.

E.g.:

Screenshot from 2024-05-15 23-21-30

Fixing that would make a situation more clear and it would be good starting point for further refactor of stores.

Moreover in some places it may be beneficial to introduce aliases, e.g.:

import AppLayouts.Wallet.stores 1.0 as WalletStores

StackLayout {
    property WalletStores.RootStore rootStore

to disambiguate RootStore- this name is repeated in many directories and usually it's not clear at first glance which one is used in given place. Prefixes may help a bit with that.