From 8286fe10f6aa9c9726dc7b2caef26d28defd43fa Mon Sep 17 00:00:00 2001 From: Micah Riggan Date: Tue, 8 Jan 2019 11:44:13 -0500 Subject: [PATCH] feature(insight): load more txs Instead of loading them all into the dom at once, load 10, and then exponentially load more --- .../components/transaction-list/transaction-list.html | 9 +++++++-- .../src/components/transaction-list/transaction-list.ts | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/insight-previous/src/components/transaction-list/transaction-list.html b/packages/insight-previous/src/components/transaction-list/transaction-list.html index e9e4170315f..faa0da526e0 100644 --- a/packages/insight-previous/src/components/transaction-list/transaction-list.html +++ b/packages/insight-previous/src/components/transaction-list/transaction-list.html @@ -5,10 +5,15 @@
- - + + + + + Load More + +
diff --git a/packages/insight-previous/src/components/transaction-list/transaction-list.ts b/packages/insight-previous/src/components/transaction-list/transaction-list.ts index 3206ca5d5e7..bf70703d46d 100644 --- a/packages/insight-previous/src/components/transaction-list/transaction-list.ts +++ b/packages/insight-previous/src/components/transaction-list/transaction-list.ts @@ -15,6 +15,9 @@ export class TransactionListComponent implements OnInit { @Input() public transactions?: any = []; + limit = 10; + chunkSize = 100; + constructor(private txProvider: TxsProvider) {} ngOnInit(): void { @@ -33,4 +36,9 @@ export class TransactionListComponent implements OnInit { this.loading = false; } } + + loadMore() { + this.limit += this.chunkSize; + this.chunkSize *= 2; + } }