-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store): add standalone features
- Loading branch information
Showing
36 changed files
with
765 additions
and
298 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
import { enableProdMode } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
import { bootstrapApplication } from '@angular/platform-browser'; | ||
import { provideAnimations } from '@angular/platform-browser/animations'; | ||
|
||
import { AppModule } from './app/app.module'; | ||
import { environment } from './environments/environment'; | ||
import { AppComponent } from './app/app.component'; | ||
import { SHARED_PLATFORM_PROVIDERS } from './shared-platform-providers'; | ||
|
||
if (environment.production) { | ||
enableProdMode(); | ||
} | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule); | ||
bootstrapApplication(AppComponent, { | ||
providers: [provideAnimations(), ...SHARED_PLATFORM_PROVIDERS] | ||
}); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { APP_ID } from '@angular/core'; | ||
import { provideRouter } from '@angular/router'; | ||
import { provideStore, withNgxsOptions } from '@ngxs/store'; | ||
import { withNgxsFormPlugin } from '@ngxs/form-plugin'; | ||
import { withNgxsLoggerPlugin } from '@ngxs/logger-plugin'; | ||
import { withNgxsReduxDevtoolsPlugin } from '@ngxs/devtools-plugin'; | ||
import { withNgxsRouterPlugin } from '@ngxs/router-plugin'; | ||
import { withNgxsStoragePlugin } from '@ngxs/storage-plugin'; | ||
|
||
import { TodosState } from '@integration/store/todos/todos.state'; | ||
import { TodoState } from '@integration/store/todos/todo/todo.state'; | ||
import { TODOS_STORAGE_KEY } from '@integration/store/todos/todos.model'; | ||
|
||
import { environment } from './environments/environment'; | ||
|
||
export const APP_ID_VALUE = 'integration-app'; | ||
|
||
export const SHARED_PLATFORM_PROVIDERS = [ | ||
{ provide: APP_ID, useValue: APP_ID_VALUE }, | ||
|
||
provideRouter([ | ||
{ path: '', pathMatch: 'full', redirectTo: '/list' }, | ||
{ | ||
path: 'list', | ||
loadChildren: () => import('@integration/list/list.module').then(m => m.ListModule) | ||
}, | ||
{ | ||
path: 'detail', | ||
loadChildren: () => import('@integration/detail/detail.module').then(m => m.DetailModule) | ||
}, | ||
{ | ||
path: 'counter', | ||
loadChildren: () => | ||
import('@integration/counter/counter.module').then(m => m.CounterModule) | ||
} | ||
]), | ||
|
||
provideStore( | ||
[TodosState, TodoState], | ||
withNgxsOptions({ | ||
developmentMode: !environment.production, | ||
selectorOptions: {} | ||
}), | ||
withNgxsFormPlugin(), | ||
withNgxsLoggerPlugin({ logger: console, collapsed: false, disabled: true }), | ||
withNgxsReduxDevtoolsPlugin({ disabled: environment.production }), | ||
withNgxsRouterPlugin(), | ||
withNgxsStoragePlugin({ key: [TODOS_STORAGE_KEY] }) | ||
) | ||
]; |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { NgxsReduxDevtoolsPluginModule } from './devtools.module'; | ||
export { NgxsReduxDevtoolsPluginModule, withNgxsReduxDevtoolsPlugin } from './devtools.module'; | ||
export { NgxsReduxDevtoolsPlugin } from './devtools.plugin'; | ||
export * from './symbols'; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { NgxsFormPluginModule } from './form.module'; | ||
export { NgxsFormPluginModule, withNgxsFormPlugin } from './form.module'; | ||
export { NgxsFormPlugin } from './form.plugin'; | ||
export { FormDirective as ɵFormDirective } from './directive'; | ||
export * from './actions'; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { NgxsLoggerPluginModule } from './logger.module'; | ||
export { NgxsLoggerPluginModule, withNgxsLoggerPlugin } from './logger.module'; | ||
export { NgxsLoggerPlugin } from './logger.plugin'; | ||
export * from './symbols'; |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { NgxsStoragePluginModule } from './storage.module'; | ||
export { NgxsStoragePluginModule, withNgxsStoragePlugin } from './storage.module'; | ||
export { NgxsStoragePlugin } from './storage.plugin'; | ||
export * from './symbols'; | ||
export * from './engines'; |
Oops, something went wrong.