Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Repository constructor with only firebase config #11

Open
ZaynJarvis opened this issue Feb 10, 2019 · 2 comments
Open

Repository constructor with only firebase config #11

ZaynJarvis opened this issue Feb 10, 2019 · 2 comments
Labels
discussion Discuss on the topic

Comments

@ZaynJarvis
Copy link
Member

Will it be better to use one field constructor?
e.g. In artwork repo
For client side code:

export function getArtworks() {
  const pplRepo = new PeopleRepository(FirebaseApp);
  const awRepo = new ArtworksRepository(FirebaseApp, pplRepo);
  // ...
}

export async function createArtwork(artwork) {
  const pplRepo = new PeopleRepository(FirebaseApp);
  const awRepo = new ArtworksRepository(FirebaseApp, pplRepo);
  // ...

Instead const pplRepo = new PeopleRepository(FirebaseApp); can be created from the library or as a optional field.

@ZaynJarvis ZaynJarvis added the discussion Discuss on the topic label Feb 10, 2019
@clarencecastillo
Copy link
Member

This might just make importing repositories easier. Do you have an example which shows this? Not sure if my understanding is correct, but I fear this will result in a lot of duplicate code.

If it's not a blocker, we can put this one in the backlog first since it's just optimising something that works. Also, what's the difference or relation with #17?

@ZaynJarvis
Copy link
Member Author

ZaynJarvis commented Feb 11, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion Discuss on the topic
Projects
None yet
Development

No branches or pull requests

3 participants