This file contains 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
// books.selectors.ts | |
import { createSelector } from "@ngrx/store"; | |
import { booksFeature } from "./books.reducer"; | |
export const selectBookListPageViewModel = createSelector( | |
booksFeature.selectBooks, | |
booksFeature.selectLoading, | |
(books, loading) => ({ books, loading }) | |
); |
This file contains 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
// `createFeature` is imported from `@ngrx/store` | |
import { createFeature, createReducer } from "@ngrx/store"; | |
import * as BookListPageActions from "./book-list-page.actions"; | |
import * as BooksApiActions from "./books-api.actions"; | |
interface State { | |
books: Book[]; | |
loading: boolean; | |
} |
This file contains 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
// books.reducer.ts | |
import { createReducer } from "@ngrx/store"; | |
import * as BookListPageActions from "./book-list-page.actions"; | |
import * as BooksApiActions from "./books-api.actions"; | |
export const featureName = "books"; | |
export interface State { | |
books: Book[]; |
This file contains 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 myReducer = createReducer(...); | |
export function reducer(state, action) { | |
return myReducer(state, action); | |
} |
This file contains 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
{ | |
"name": "myorg", | |
"scripts": { | |
"start": "nx serve", | |
"build": "nx build", | |
"test": "nx test" | |
}, | |
"dependencies": { | |
... | |
}, |
This file contains 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
class MyDto { | |
static _OPENAPI_METADATA_FACTORY() { | |
return { | |
id: { required: true, type: () => String }, | |
count: { required: true, type: () => Number } | |
}; | |
} | |
} | |
exports.MyDto = MyDto; |
This file contains 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
"targets": { | |
"build": { | |
"executor": "@nrwl/node:build", | |
"outputs": ["{options.outputPath}"], | |
"options": { | |
"outputPath": "dist/apps/my-server", | |
"main": "apps/my-server/src/main.ts", | |
"tsConfig": "apps/my-server/tsconfig.app.json", | |
"assets": ["apps/my-server/src/assets"], | |
+ "tsPlugins": ["@nestjs/swagger/plugin"] |
This file contains 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 class MyDto { | |
id: string; | |
count: number; | |
} |
This file contains 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
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"ngv12": { | |
"projectType": "application", | |
"schematics": {}, | |
"root": "", | |
"sourceRoot": "src", |
This file contains 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 { getJestProjects } = require('@nrwl/jest'); | |
+ module.exports = { projects: getJestProjects() }; | |
- module.exports = { | |
- projects: [ | |
- '<rootDir>/apps/products', | |
- '<rootDir>/apps/cart', | |
- '<rootDir>/libs/shared/product/ui', | |
- '<rootDir>/libs/products/home-page', | |
- '<rootDir>/libs/cart/cart-page', |