Vladimir  Golub
Vladimir Golub

Reputation: 623

Where better to keep common functions?

I have functions for working with date in class.

export class DateName {
  weekDaysList() {...}
}

Do I need to create a module with a service for a date? Import the class where needed?

Upvotes: 0

Views: 1833

Answers (1)

Xwebyna
Xwebyna

Reputation: 54

According to my experience, a service should contain methods that communicate between the controllers and the persistent layers.

Date functions, in this case, should live in the helper or utility folder.

Upvotes: 2

Related Questions