-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ENTRY): Group entries and render them
Not performant, replacing children every render is expensive.❌
- Loading branch information
1 parent
a7059c4
commit 87b8921
Showing
11 changed files
with
296 additions
and
134 deletions.
There are no files selected for viewing
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
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,17 +1,9 @@ | ||
import { Store, subscribe } from "@store"; | ||
import { generateTrackerEntry } from "./trackerEntry"; | ||
import { renderEntries } from "../../main"; | ||
|
||
subscribe(Store.entries, () => { | ||
const compareDate = (a: IEntry, b: IEntry) => { | ||
const aa = Date.parse(a.date); | ||
const bb = Date.parse(b.date); | ||
|
||
return bb - aa; | ||
}; | ||
|
||
Store.entries.sort(compareDate); | ||
|
||
generateTrackerEntry(); | ||
}); | ||
// subscribe(Store.entries, () => { | ||
// renderEntries(); | ||
// }); | ||
|
||
export { generateTrackerEntry }; |
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
Oops, something went wrong.