├── src ├── assets │ └── .gitkeep ├── favicon.ico ├── styles.css ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── app │ ├── deep-performance │ │ ├── deep-performance.component.html │ │ └── deep-performance.component.ts │ ├── wide-performance │ │ ├── wide-performance.component.html │ │ └── wide-performance.component.ts │ ├── integration-store.ts │ ├── integration-state.ts │ ├── package.json │ ├── app.module.ts │ ├── app.component.html │ └── app.component.ts ├── index.html ├── main.ts ├── test.ts └── polyfills.ts ├── projects ├── counter-demo │ ├── src │ │ ├── assets │ │ │ └── .gitkeep │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── styles.css │ │ ├── favicon.ico │ │ ├── index.html │ │ ├── main.ts │ │ ├── app │ │ │ ├── app.module.ts │ │ │ ├── counter.ts │ │ │ └── my-app.component.ts │ │ ├── test.ts │ │ └── polyfills.ts │ ├── tslint.json │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── .browserslistrc │ └── karma.conf.js └── ng-app-state │ ├── src │ ├── typing-tests │ │ ├── index.d.ts │ │ ├── push-to-store-array.dts-spec.ts │ │ ├── tsconfig.json │ │ └── store-object.dts-spec.ts │ ├── performance │ │ ├── counter-state.ts │ │ ├── wide-performance.ts │ │ ├── deep-performance.ts │ │ └── performance.spec.ts │ ├── lib │ │ ├── utils │ │ │ ├── index.ts │ │ │ ├── push-to-store-array.ts │ │ │ ├── spread-array-store.ts │ │ │ ├── spread-object-store.ts │ │ │ ├── push-to-store-array.spec.ts │ │ │ ├── spread-array-store.spec.ts │ │ │ ├── spread-object-store.spec.ts │ │ │ ├── undo-manager.ts │ │ │ └── undo-manager.spec.ts │ │ ├── actions │ │ │ ├── app-state-action.ts │ │ │ ├── batch-action.ts │ │ │ └── function-action.ts │ │ ├── ng-app-state-reducer.ts │ │ ├── nas-model │ │ │ ├── value-accessors │ │ │ │ ├── range-value-accessor.directive.ts │ │ │ │ ├── checkbox-value-accessor.directive.ts │ │ │ │ ├── radio-value-accessor.directive.ts │ │ │ │ ├── abstract-input-value-accessor.directive.ts │ │ │ │ ├── select-value-accessor.directive.ts │ │ │ │ ├── select-multiple-value-accessor.directive.ts │ │ │ │ ├── abstract-value-accessor.directive.ts │ │ │ │ ├── input-value-accessor.directive.ts │ │ │ │ └── number-value-accessor.directive.ts │ │ │ ├── nas-model.module.ts │ │ │ └── nas-model.directive.ts │ │ ├── app-store.ts │ │ ├── tree-based-observable │ │ │ ├── tree-based-observable-factory.ts │ │ │ └── observable-node.ts │ │ ├── app-store.spec.ts │ │ ├── store-object.ts │ │ └── store-object.spec.ts │ ├── public-api.ts │ ├── test.ts │ └── test-helpers.ts │ ├── ng-package.json │ ├── tsconfig.lib.prod.json │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── package.json │ ├── tsconfig.lib.json │ └── karma.conf.js ├── .idea ├── .gitignore ├── encodings.xml ├── misc.xml ├── codeStyles │ ├── codeStyleConfig.xml │ └── Project.xml ├── modules.xml ├── prettier.xml ├── vcs.xml ├── runConfigurations │ ├── Docs.xml │ ├── Lib___dtslint.xml │ ├── Integration___Start.xml │ ├── Lib___Test.xml │ ├── Tests.xml │ ├── Lib___Build.xml │ ├── Integration___E2E.xml │ └── Counter___Start.xml ├── codeStyleSettings.xml ├── ng-app-state.iml └── inspectionProfiles │ └── Project_Default.xml ├── tslint.json ├── .prettierignore ├── e2e ├── src │ ├── app.po.ts │ └── app.e2e-spec.ts ├── protractor-ci.conf.js ├── tsconfig.json └── protractor.conf.js ├── README.md ├── tsconfig.app.json ├── .editorconfig ├── tsconfig.spec.json ├── standard-version-postbump.ts ├── .browserlistrc ├── docs └── typedoc │ └── index.html ├── tsconfig.json ├── .travis.yml ├── .gitignore ├── tsconfig.base.json ├── LICENSE ├── karma.conf.js ├── package.json ├── angular.json └── CHANGELOG.md /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/counter-demo/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/typing-tests/index.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /workspace.xml -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { "extends": "s-ng-dev-utils/tslint" } 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | coverage/ 3 | dist/ 4 | node_modules/ 5 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simontonsoftware/ng-app-state/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/performance/counter-state.ts: -------------------------------------------------------------------------------- 1 | export class CounterState { 2 | counter = 0; 3 | } 4 | -------------------------------------------------------------------------------- /projects/counter-demo/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true, 3 | }; 4 | -------------------------------------------------------------------------------- /projects/counter-demo/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /projects/counter-demo/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simontonsoftware/ng-app-state/HEAD/projects/counter-demo/src/favicon.ico -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser } from 'protractor'; 2 | 3 | export class AppPage { 4 | navigateTo(): Promise { 5 | return browser.get(browser.baseUrl) as Promise; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/app/deep-performance/deep-performance.component.html: -------------------------------------------------------------------------------- 1 |
2 | Depth 3 |
4 | Iterations 5 |
6 | 7 | -------------------------------------------------------------------------------- /src/app/wide-performance/wide-performance.component.html: -------------------------------------------------------------------------------- 1 |
2 | Width 3 |
4 | Iterations 5 |
6 | 7 | -------------------------------------------------------------------------------- /projects/ng-app-state/ng-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", 3 | "dest": "../../dist/ng-app-state", 4 | "lib": { 5 | "entryFile": "src/public-api.ts" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Moved 2 | 3 | This is an old version. The library moved to a new repo [here](https://github.com/simontonsoftware/s-libs/tree/master/projects/app-state), as in now published under the name `@s-libs/app-state` in NPM. 4 | -------------------------------------------------------------------------------- /projects/counter-demo/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "my", "camelCase"], 5 | "component-selector": [true, "element", "my", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /projects/ng-app-state/tsconfig.lib.prod.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.lib.json", 4 | "angularCompilerOptions": { 5 | "enableIvy": false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /projects/ng-app-state/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../../tslint.json"], 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nas", "camelCase"], 5 | "component-selector": [true, "element", "nas", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/lib/utils/index.ts: -------------------------------------------------------------------------------- 1 | export { pushToStoreArray } from './push-to-store-array'; 2 | export { spreadArrayStore$ } from './spread-array-store'; 3 | export { spreadObjectStore$ } from './spread-object-store'; 4 | export { UndoManager } from './undo-manager'; 5 | -------------------------------------------------------------------------------- /e2e/protractor-ci.conf.js: -------------------------------------------------------------------------------- 1 | const config = require("./protractor.conf").config; 2 | 3 | config.capabilities = { 4 | browserName: "chrome", 5 | chromeOptions: { 6 | args: ["--headless", "--no-sandbox", "--disable-gpu"], 7 | }, 8 | }; 9 | 10 | exports.config = config; 11 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/typing-tests/push-to-store-array.dts-spec.ts: -------------------------------------------------------------------------------- 1 | import { pushToStoreArray, StoreObject } from '../public-api'; 2 | 3 | const store = (null as unknown) as StoreObject>; 4 | 5 | // $ExpectType StoreObject 6 | pushToStoreArray(store, new Date()); 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.base.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.base.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": ["jasmine", "jasminewd2", "node"] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.idea/prettier.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /projects/counter-demo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.base.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.base.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/public-api.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * Public API Surface of ng-app-state 3 | */ 4 | 5 | export { AppStore } from './lib/app-store'; 6 | export { ngAppStateReducer } from './lib/ng-app-state-reducer'; 7 | export { StoreObject } from './lib/store-object'; 8 | export { NasModelModule } from './lib/nas-model/nas-model.module'; 9 | export * from './lib/utils'; 10 | -------------------------------------------------------------------------------- /projects/counter-demo/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../../tsconfig.base.json", 4 | "compilerOptions": { 5 | "outDir": "../../out-tsc/spec", 6 | "types": ["jasmine"] 7 | }, 8 | "files": ["src/test.ts", "src/polyfills.ts"], 9 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NgAppStatePlatform 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/counter-demo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CounterDemo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/lib/actions/app-state-action.ts: -------------------------------------------------------------------------------- 1 | import { Action } from '@ngrx/store'; 2 | 3 | /** @hidden */ 4 | export abstract class AppStateAction implements Action { 5 | type: string; 6 | 7 | constructor(name: string, protected path: string[], protected value?: any) { 8 | this.type = `[${name}] ${path.join('.')}`; 9 | } 10 | 11 | abstract execute(rootState: T): T; 12 | } 13 | -------------------------------------------------------------------------------- /src/app/integration-store.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { Store } from '@ngrx/store'; 3 | import { AppStore } from 'ng-app-state'; 4 | import { IntegrationState } from './integration-state'; 5 | 6 | @Injectable() 7 | export class IntegrationStore extends AppStore { 8 | constructor(store: Store) { 9 | super(store, 'state', new IntegrationState()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /standard-version-postbump.ts: -------------------------------------------------------------------------------- 1 | import { writeFileSync } from 'fs'; 2 | import { format } from 'prettier'; 3 | 4 | const packageJson = require('./package.json'); 5 | const libPackageJson = require('./projects/ng-app-state/package.json'); 6 | writeFileSync( 7 | './projects/ng-app-state/package.json', 8 | format(JSON.stringify({ ...libPackageJson, version: packageJson.version }), { 9 | parser: 'json', 10 | }), 11 | ); 12 | -------------------------------------------------------------------------------- /projects/ng-app-state/src/typing-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "noImplicitAny": true, 5 | "noImplicitThis": true, 6 | "strictNullChecks": true, 7 | "strictFunctionTypes": true, 8 | "lib": ["es2018", "dom"], 9 | "noEmit": true, 10 | "target": "es2015", 11 | 12 | "baseUrl": "../lib", 13 | 14 | "experimentalDecorators": true 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic() 12 | .bootstrapModule(AppModule) 13 | .catch((err) => console.log(err)); 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations/Docs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |