Skip to content

Commit

Permalink
Revert "feat: Introduce signals"
Browse files Browse the repository at this point in the history
This reverts commit 4934a4a.
  • Loading branch information
grand-rick committed Feb 22, 2024
1 parent 4934a4a commit 425b5e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="px-6 py-6 flex flex-col justify-between">
<blogs-list [blogs]="filteredBlogs()"></blogs-list>
<blogs-list [blogs]="blogs"></blogs-list>
<search-bar></search-bar>
<latest-blogs class="h-3/4" [blogs]="filteredBlogs()"></latest-blogs>
<latest-blogs class="h-3/4" [blogs]="blogs"></latest-blogs>
</div>
24 changes: 3 additions & 21 deletions src/app/modules/blogs/main-content/main-content.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Component, signal } from '@angular/core';
// import { NgxPaginationModule } from 'ngx-pagination';
import { Component, Input } from '@angular/core';
import { LatestBlogsComponent } from './latest-blogs/latest-blogs.component';
import { BlogsListComponent } from './blogs-list/blogs-list.component';
import { SearchBarComponent } from './search-bar/search-bar.component';
Expand All @@ -15,14 +14,8 @@ import { BlogModel } from '../../../models/blog.model';
styleUrl: './main-content.component.scss',
})
export class MainContentComponent {
page: number = 1;
count: number = 0;
tableSize: number = 7;
tableSizes: any = [3, 6, 9, 12];

loading: boolean = true;
blogs = signal([]);
filteredBlogs = signal([]);
blogs: BlogModel[] = [];

constructor(private apollo: Apollo) {}

Expand All @@ -37,22 +30,11 @@ export class MainContentComponent {
})
.valueChanges.subscribe(({ data, error }: any) => {
console.log(data);
this.blogs.set(data.blogs);
this.filteredBlogs.set(data.blogs);
this.blogs = data.blogs;
this.loading = false;
if (error) {
console.error(error);
}
});
}

// onTableDataChange(event: any) {
// this.page = event;
// this.loadBlogs();
// }
// onTableSizeChange(event: any): void {
// this.tableSize = event.target.value;
// this.page = 1;
// this.loadBlogs();
// }
}

0 comments on commit 425b5e9

Please sign in to comment.