Move all firbase dependencies from actions layer to firebaseService layer (#13)

This commit is contained in:
Qolzam
2017-10-12 17:47:26 +07:00
parent c82826bdd4
commit 0785c38d42
48 changed files with 1305 additions and 796 deletions

View File

@@ -1,10 +1,76 @@
import {IAuthorizeService} from 'services/authorize/IAuthorizeService'
export interface IServiceProvider{
/**
* Create authorize service
*
* @memberof IServiceProvider
*/
createAuthorizeService : () => IAuthorizeService
import { IAuthorizeService } from 'services/authorize/IAuthorizeService'
import { ICircleService } from 'services/circles'
import { ICommentService } from 'services/comments'
import { ICommonService } from 'services/common'
import { IImageGalleryService } from 'services/imageGallery'
import { INotificationService } from 'services/notifications'
import { IPostService } from 'services/posts'
import { IUserService } from 'services/users'
import { IVoteService } from 'services/votes'
}
export interface IServiceProvider {
/**
* Create authorize service
*
* @memberof IServiceProvider
*/
createAuthorizeService: () => IAuthorizeService
/**
* Create instant for Circle Service
*
* @memberof ServiceProvide
*/
createCircleService: () => ICircleService
/**
* Create instant for Comment Service
*
* @memberof ServiceProvide
*/
createCommentService: () => ICommentService
/**
* Create instant for Common Service
*
* @memberof ServiceProvide
*/
createCommonService: () => ICommonService
/**
* Create instant for ImageGallery Service
*
* @memberof ServiceProvide
*/
createImageGalleryService: () => IImageGalleryService
/**
* Create instant for Notification Service
*
* @memberof ServiceProvide
*/
createNotificationService: () => INotificationService
/**
* Create instant for Post Service
*
* @memberof ServiceProvide
*/
createPostService: () => IPostService
/**
* Create instant for User Service
*
* @memberof ServiceProvide
*/
createUserService: () => IUserService
/**
* Create instant for Vote Service
*
* @memberof ServiceProvide
*/
createVoteService: () => IVoteService
}

View File

@@ -2,25 +2,114 @@
import { IServiceProvider } from 'factories'
import { IAuthorizeService } from 'services/authorize'
import { ICircleService } from 'services/circles'
import { ICommentService } from 'services/comments'
import { ICommonService } from 'services/common'
import { IImageGalleryService } from 'services/imageGallery'
import { INotificationService } from 'services/notifications'
import { IPostService } from 'services/posts'
import { IUserService } from 'services/users'
import { IVoteService } from 'services/votes'
//#endregion
//#region Service implemented classes
// - Firebase services
import { AuthorizeService } from 'firebaseServices/authorize'
// - Firebase services
import { AuthorizeService } from 'firebaseServices/authorize'
import { CircleService } from 'firebaseServices/circles'
import { CommentService } from 'firebaseServices/comments'
import { CommonService } from 'firebaseServices/common'
import { ImageGalleryService } from 'firebaseServices/imageGallery'
import { NotificationService } from 'firebaseServices/notifications'
import { PostService } from 'firebaseServices/posts'
import { UserService } from 'firebaseServices/users'
import { VoteService } from 'firebaseServices/votes'
//#endregion
export class ServiceProvide implements IServiceProvider {
/**
* Create instant for AuthorizeService
*
* @memberof ServiceProvide
*/
createAuthorizeService: () => IAuthorizeService = () => {
return new AuthorizeService()
}
}
/**
* Create instant for Authorize Service
*
* @memberof ServiceProvide
*/
createAuthorizeService: () => IAuthorizeService = () => {
return new AuthorizeService()
}
/**
* Create instant for Circle Service
*
* @memberof ServiceProvide
*/
createCircleService: () => ICircleService = () => {
return new CircleService()
}
/**
* Create instant for Comment Service
*
* @memberof ServiceProvide
*/
createCommentService: () => ICommentService = () => {
return new CommentService()
}
/**
* Create instant for Common Service
*
* @memberof ServiceProvide
*/
createCommonService: () => ICommonService = () => {
return new CommonService()
}
/**
* Create instant for ImageGallery Service
*
* @memberof ServiceProvide
*/
createImageGalleryService: () => IImageGalleryService = () => {
return new ImageGalleryService()
}
/**
* Create instant for Notification Service
*
* @memberof ServiceProvide
*/
createNotificationService: () => INotificationService = () => {
return new NotificationService()
}
/**
* Create instant for Post Service
*
* @memberof ServiceProvide
*/
createPostService: () => IPostService = () => {
return new PostService()
}
/**
* Create instant for User Service
*
* @memberof ServiceProvide
*/
createUserService: () => IUserService = () => {
return new UserService()
}
/**
* Create instant for Vote Service
*
* @memberof ServiceProvide
*/
createVoteService: () => IVoteService = () => {
return new VoteService()
}
}