gitbase-web icon indicating copy to clipboard operation
gitbase-web copied to clipboard

Move "api.js" into its own place

Open dpordomingo opened this issue 7 years ago • 0 comments
trafficstars

from https://github.com/src-d/gitbase-playground/pull/16#discussion_r187622649

We could move frontend/src/api.js into its own place as done in CAT for example.

I see two reasons:

  • first one is kindof opinionated: imo the root dir should be populated with as fewer things as possible because it helps to understand better the structure of the code.
  • second one is generic: now we have in this file the logic (copy-pasted from cat) to connect with the API (business agnostic), and also the "repository-like" code (business related). Splitting both parts properly, and moving business agnostic to a service, and the business logic to a repository would help us to reuse and test better.

dpordomingo avatar May 16 '18 07:05 dpordomingo