This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const customStorage: Storage = { | |
| length: 0, | |
| clear: function(): void { | |
| if (window && window.localStorage) { | |
| window.localStorage.clear(); | |
| this.length = window.localStorage.length; | |
| } | |
| }, | |
| getItem: function(key: string): string | null { | |
| try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Injectable } from '@angular/core'; | |
| import { select, Store } from '@ngrx/store'; | |
| import { Observable } from 'rxjs'; | |
| import { selectAllProjects, selectCurrentProject } from '..'; | |
| import { Project } from '../../projects/project.model'; | |
| import { ProjectsState } from './projects.reducer'; | |
| import { LoadProjects, AddProject, UpdateProject, DeleteProject, SelectProject } from './projects.actions'; | |
| @Injectable({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const entities = posts.reduce( | |
| (entities: { [id: string]: Post }, post: Post) => { | |
| return { | |
| ...entities, | |
| [post._id]: post, | |
| }; | |
| }, | |
| { | |
| ...state.entities, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { | |
| Directive, | |
| Renderer2, | |
| TemplateRef, | |
| ViewContainerRef, | |
| Input | |
| } from '@angular/core'; | |
| @Directive({ | |
| selector: '[appMy]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| providers: [ | |
| { | |
| provide: LOCALE_ID, | |
| useFactory: (translate: I18nService) => { | |
| return translate.language; | |
| }, | |
| deps: [I18nService] | |
| } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Service | |
| import { Injectable } from '@angular/core'; | |
| import {TranslateService, LangChangeEvent} from '@ngx-translate/core'; | |
| export function extract(s: string) { | |
| return s; | |
| } | |
| @Injectable({ | |
| providedIn: 'root' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const autoprefixer = require("autoprefixer"); | |
| const eslintFormatter = require("react-dev-utils/eslintFormatter"); | |
| const flexbugsFixes = require("postcss-flexbugs-fixes"); | |
| const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
| const webpack = require("webpack"); | |
| // Utils | |
| const envs = require("./env"); | |
| const paths = require("./paths"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // App | |
| import { AuthLayoutMain } from "./features/auth/layout"; | |
| const BlogLayoutMain = lazy(() => import('./features/blog/layout')); | |
| //import { BlogLayoutMain } from "./features/blog/layout"; | |
| import { AdminLayoutMain } from "./features/admin/layout"; | |
| const App = () => { | |
| return ( | |
| <MuiThemeProvider theme={theme}> | |
| <Suspense fallback={<div>Loading...</div>}> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import axios from "./axios"; | |
| import { Storage } from "./utils/storage"; | |
| const setupAxiosInterceptors = onUnauthenticated => { | |
| const onRequestSuccess = config => { | |
| console.log("request success", config); | |
| const token = Storage.local.get("auth"); | |
| if (token) { | |
| config.headers.Authorization = `${token.token}`; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const autoprefixer = require("autoprefixer"); | |
| const eslintFormatter = require("react-dev-utils/eslintFormatter"); | |
| const flexbugsFixes = require("postcss-flexbugs-fixes"); | |
| const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
| const webpack = require("webpack"); | |
| // Utils | |
| const envs = require("./env"); | |
| const paths = require("./paths"); |