From 3d3a6c120442a076bd8c9dbc3c9b4f4c452dd2ff Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 9 Apr 2022 09:03:39 +0200 Subject: [PATCH] Feature/improve fire section (#813) * Improve FIRE section * Update changelog --- CHANGELOG.md | 6 +++++ .../portfolio/fire/fire-page.component.ts | 25 +++++-------------- .../app/pages/portfolio/fire/fire-page.html | 13 ++++++---- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a2791e31..a59abcf33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Improved the 4% rule in the _FIRE_ section + ## 1.133.0 - 07.04.2022 ### Changed diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts index 1eb132dfd..1ca20dd11 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.component.ts @@ -14,12 +14,11 @@ import { takeUntil } from 'rxjs/operators'; templateUrl: './fire-page.html' }) export class FirePageComponent implements OnDestroy, OnInit { - public fireWealth: number; - public hasImpersonationId: boolean; + public fireWealth: Big; public isLoading = false; public user: User; - public withdrawalRatePerMonth: number; - public withdrawalRatePerYear: number; + public withdrawalRatePerMonth: Big; + public withdrawalRatePerYear: Big; private unsubscribeSubject = new Subject(); @@ -39,13 +38,6 @@ export class FirePageComponent implements OnDestroy, OnInit { public ngOnInit() { this.isLoading = true; - this.impersonationStorageService - .onChangeHasImpersonation() - .pipe(takeUntil(this.unsubscribeSubject)) - .subscribe((aId) => { - this.hasImpersonationId = !!aId; - }); - this.dataService .fetchPortfolioSummary() .pipe(takeUntil(this.unsubscribeSubject)) @@ -54,14 +46,9 @@ export class FirePageComponent implements OnDestroy, OnInit { return; } - this.fireWealth = new Big(currentValue).plus(cash).toNumber(); - this.withdrawalRatePerYear = new Big(this.fireWealth) - .mul(4) - .div(100) - .toNumber(); - this.withdrawalRatePerMonth = new Big(this.withdrawalRatePerYear) - .div(12) - .toNumber(); + this.fireWealth = new Big(currentValue); + this.withdrawalRatePerYear = this.fireWealth.mul(4).div(100); + this.withdrawalRatePerMonth = this.withdrawalRatePerYear.div(12); this.isLoading = false; diff --git a/apps/client/src/app/pages/portfolio/fire/fire-page.html b/apps/client/src/app/pages/portfolio/fire/fire-page.html index 69735c196..4aa0f31ed 100644 --- a/apps/client/src/app/pages/portfolio/fire/fire-page.html +++ b/apps/client/src/app/pages/portfolio/fire/fire-page.html @@ -27,7 +27,8 @@ > per year @@ -36,16 +37,18 @@ > per month, based on your net worth of + >, based on your investment of - (excluding emergency fund) and a withdrawal rate of 4%. + and a withdrawal rate of 4%.