phisith / nimble-technical-test

Nimble test
0 stars 0 forks source link

[Chore] Extract dependency to application domain #7

Open olivierobert opened 1 year ago

olivierobert commented 1 year ago

Issue

The frontend application relies on numerous dependencies such as axios to make API requests and react-hot-toast to display error messages. These dependencies are imported into numerous files in the codebase, making any change to these dependencies cumbersome.

Expected

Create a lib directory with methods or classes where the dependencies are imported only once, and an abstraction layer is used, e.g.:

// lib/request.js
import axios from "axios";

// implementation code to make request with axios
// frontend/src/hooks/useFetchKeywords.ts

import request from '../lib/request'

// Use implementation instead of axios directly
phisith commented 1 year ago

Hi Mr. Olivier, please help me to preview my code as I have Merged.

Thank you

olivierobert commented 1 year ago

I have reviewed the changes and added some comments 👍