Skip to content

Commit

Permalink
refactor: 💡 deprecate ngondestroy
Browse files Browse the repository at this point in the history
  • Loading branch information
NetanelBasal committed Jun 7, 2021
1 parent cd9bc72 commit 45a9d11
Show file tree
Hide file tree
Showing 14 changed files with 45 additions and 310 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -10,3 +10,4 @@

- improve `distinctUntilArrayItemChanged` performance
- update dependency `schematics-utilities`
- deprecate `ngOnDestroy`
32 changes: 14 additions & 18 deletions apps/angular-store-app/src/app/app-routing.module.ts
@@ -1,65 +1,61 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProductsComponent } from './products/products.component';
import { AuthGuard } from './auth/auth.guard';
import { LoginComponent } from './auth/login/login.component';
import { CartComponent } from './cart/cart.component';
import { ProductPageComponent } from './product-page/product-page.component';
import { LoginComponent } from './auth/login/login.component';
import { AuthGuard } from './auth/auth.guard';
import { ProductsComponent } from './products/products.component';

const routes: Routes = [
{
component: ProductsComponent,
path: '',
pathMatch: 'full',
canActivate: [AuthGuard]
canActivate: [AuthGuard],
},
{
component: ProductPageComponent,
path: 'product/:id',
canActivate: [AuthGuard]
canActivate: [AuthGuard],
},
{
component: CartComponent,
path: 'cart',
canActivate: [AuthGuard]
canActivate: [AuthGuard],
},
{
component: LoginComponent,
path: 'login'
path: 'login',
},
{
path: 'todos',
canActivate: [AuthGuard],
loadChildren: () => import('./todos-app/todos.module').then(m => m.TodosModule)
loadChildren: () => import('./todos-app/todos.module').then((m) => m.TodosModule),
},
{
path: 'contacts',
loadChildren: () => import('./contacts/contacts.module').then(m => m.ContactsModule)
loadChildren: () => import('./contacts/contacts.module').then((m) => m.ContactsModule),
},
{
path: 'stories',
loadChildren: () => import('./stories/stories.module').then(m => m.StoriesModule)
loadChildren: () => import('./stories/stories.module').then((m) => m.StoriesModule),
},
{
path: 'movies',
loadChildren: () => import('./movies/movies.module').then(m => m.MoviesModule)
loadChildren: () => import('./movies/movies.module').then((m) => m.MoviesModule),
},
{
path: 'widgets',
loadChildren: () => import('./widgets/widgets.module').then(m => m.WidgetsModule)
loadChildren: () => import('./widgets/widgets.module').then((m) => m.WidgetsModule),
},
{
path: 'posts',
loadChildren: () => import('./posts/posts.module').then(m => m.PostsModule)
loadChildren: () => import('./posts/posts.module').then((m) => m.PostsModule),
},
{
path: 'formsmanager',
loadChildren: () => import('./forms-manager/forms-manager.module').then(m => m.FormsManagerModule)
}
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
exports: [RouterModule],
})
export class AppRoutingModule {}

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions docs/docs/angular/forms-manager.mdx

This file was deleted.

1 change: 0 additions & 1 deletion docs/sidebars.js
Expand Up @@ -81,7 +81,6 @@ module.exports = {
href: 'https://github.com/dappsnation/akita-ng-fire',
},
'angular/router',
'angular/forms-manager',
'angular/persist-form',
'angular/schematics',
{
Expand Down
10 changes: 10 additions & 0 deletions libs/akita/src/lib/store.ts
Expand Up @@ -267,6 +267,16 @@ export class Store<S = any> {
return nextState;
}

/**
*
* @deprecated
*
* This method will be removed in v7
*
* Akita isn't coupled to Angular and should not use Angular
* specific code
*
*/
ngOnDestroy() {
this.destroy();
}
Expand Down
3 changes: 0 additions & 3 deletions nx.json
Expand Up @@ -23,9 +23,6 @@
"akita-ng-devtools": {
"tags": ["plugin"]
},
"akita-ng-forms-manager": {
"tags": ["plugin"]
},
"akita-schematics": {
"tags": ["schematics"]
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -74,9 +74,9 @@
"@angular/router": "11.0.5",
"@netbasal/content-loader": "^1.1.0",
"faker": "^4.1.0",
"helpful-decorators": "^2.0.6",
"helpful-decorators": "2.1.0",
"lodash": "4.17.20",
"rxjs": "6.5.5",
"rxjs": "6.6.7",
"schematics-utilities": "2.0.3",
"ts-action": "^11.0.0",
"ts-action-operators": "^9.1.1",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Expand Up @@ -20,7 +20,6 @@
"@datorama/akita-ng-entity-service": ["libs/akita-ng-entity-service/src/index.ts"],
"@datorama/akita-ng-router-store": ["libs/akita-ng-router-store/src/index.ts"],
"@datorama/akita-ngdevtools": ["libs/akita-ng-devtools/src/index.ts"],
"@datorama/akita-ng-forms-manager": ["libs/akita-ng-forms-manager/src/index.ts"],
"@datorama/akita-ng-effects": ["libs/akita-ng-effects/src/index.ts"]
}
},
Expand Down

0 comments on commit 45a9d11

Please sign in to comment.