decentraland / decentraland/builder
Refactor: Consistent selectors
- Dominant language
- TypeScript
- Stars
- 156
- Forks
- 91
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 31
Description
We're currently using a few unspoken conventions to name our selectors that we need to write down so we can keep some consistency. We can move the result of this issue/discussion to the [standards repo](https://github.com/decentraland/standards)
The main things we need to focus on how to call selectors that:
- return data associated with the current wallet
- return a Record by a particular key
- return a value based on an argument
And the solution we agreed upon is (in the same order)
- We'll use `User` to denote the current connected wallet, and prefix the method with it. So for example to get the user's `Entity`s, we'd do `getUserEntities`
- If we have to return something like `Record`, the selector should be called `getEntityByKey`
- Just use the example above
What do you guys think?
@cazala did I miss something?
The only thing I'm a bit hesitant about is using `User` when we already have `wallet` as a module name in dapps.
Contributor guide
Assessment
This issue has not been assessed yet.