decentraland / decentraland/builder

Refactor: Consistent selectors

Open
#1,172 0 comments 6 reactions 3 assignees Claimed by @cazala View on GitHub
chore
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.