dw-innovation / dw-kid2-graph-frontend-prototype

dw-kid2-graph-frontend-prototype.vercel.app
MIT License
0 stars 0 forks source link

refactor `database/` namespaces #105

Open nikonikoniko opened 2 years ago

nikonikoniko commented 2 years ago

database/queries should actually only include functions to return mango queries.

for example:

const data_YoutubeUrls = () => ({
      selector: {
        data__type: Types.DataType.youtube_url,
      },
    })

the rxdb observable returning functions should be moved to another namespace, probably database/index or database/observe or something.

This change will allow us to look at all of the queries simply in one place, as they are not tracked by the type system. change in type keys must be separately reflected in the queries.

nikonikoniko commented 2 years ago

Each query should also be backed up with tests, so that a type change will let us know which queries also need changing.