From f5bae60e0ffcf479f76f94aaa4a62f7e70cd5470 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 21 May 2025 11:24:13 +0200
Subject: [PATCH 1/3] refactor: remove debounce on dice calculations
---
frontend/src/app/feature/game/dice/dice.component.ts | 1 -
1 file changed, 1 deletion(-)
diff --git a/frontend/src/app/feature/game/dice/dice.component.ts b/frontend/src/app/feature/game/dice/dice.component.ts
index 61cc1e4..08119fb 100644
--- a/frontend/src/app/feature/game/dice/dice.component.ts
+++ b/frontend/src/app/feature/game/dice/dice.component.ts
@@ -42,7 +42,6 @@ export class DiceComponent implements OnInit {
ngOnInit(): void {
this.diceForm.valueChanges
.pipe(
- debounceTime(100),
tap(() => this.calculateWinChanceAndPotentialWin())
)
.subscribe();
--
2.47.2
From 54e9ccf4263991ba9417ef7a8f8091da8c286265 Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 21 May 2025 11:28:10 +0200
Subject: [PATCH 2/3] style: appropriately touch quality tools
---
.../app/feature/game/dice/dice.component.ts | 24 +++++++------------
1 file changed, 8 insertions(+), 16 deletions(-)
diff --git a/frontend/src/app/feature/game/dice/dice.component.ts b/frontend/src/app/feature/game/dice/dice.component.ts
index 08119fb..f434584 100644
--- a/frontend/src/app/feature/game/dice/dice.component.ts
+++ b/frontend/src/app/feature/game/dice/dice.component.ts
@@ -1,16 +1,10 @@
-import { Component, signal, inject, OnInit } from '@angular/core';
-import { CommonModule } from '@angular/common';
-import {
- FormBuilder,
- FormControl,
- FormGroup,
- ReactiveFormsModule,
- Validators,
-} from '@angular/forms';
-import { DiceService } from './dice.service';
-import { DiceDto, DiceResult } from './dice.model';
-import { debounceTime, tap } from 'rxjs/operators';
-import { UserService } from '@service/user.service';
+import {Component, inject, OnInit, signal} from '@angular/core';
+import {CommonModule} from '@angular/common';
+import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators,} from '@angular/forms';
+import {DiceService} from './dice.service';
+import {DiceDto, DiceResult} from './dice.model';
+import {tap} from 'rxjs/operators';
+import {UserService} from '@service/user.service';
type DiceFormGroup = FormGroup<{
betAmount: FormControl;
@@ -41,9 +35,7 @@ export class DiceComponent implements OnInit {
ngOnInit(): void {
this.diceForm.valueChanges
- .pipe(
- tap(() => this.calculateWinChanceAndPotentialWin())
- )
+ .pipe(tap(() => this.calculateWinChanceAndPotentialWin()))
.subscribe();
this.calculateWinChanceAndPotentialWin();
--
2.47.2
From 26a2e0cdbf37a3199b694b3ce2fde4a8baac15aa Mon Sep 17 00:00:00 2001
From: Phan Huy Tran
Date: Wed, 21 May 2025 11:29:51 +0200
Subject: [PATCH 3/3] style: appropriately touch quality tools again
---
.../app/feature/game/dice/dice.component.ts | 20 ++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/frontend/src/app/feature/game/dice/dice.component.ts b/frontend/src/app/feature/game/dice/dice.component.ts
index f434584..fe50cf6 100644
--- a/frontend/src/app/feature/game/dice/dice.component.ts
+++ b/frontend/src/app/feature/game/dice/dice.component.ts
@@ -1,10 +1,16 @@
-import {Component, inject, OnInit, signal} from '@angular/core';
-import {CommonModule} from '@angular/common';
-import {FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators,} from '@angular/forms';
-import {DiceService} from './dice.service';
-import {DiceDto, DiceResult} from './dice.model';
-import {tap} from 'rxjs/operators';
-import {UserService} from '@service/user.service';
+import { Component, inject, OnInit, signal } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import {
+ FormBuilder,
+ FormControl,
+ FormGroup,
+ ReactiveFormsModule,
+ Validators,
+} from '@angular/forms';
+import { DiceService } from './dice.service';
+import { DiceDto, DiceResult } from './dice.model';
+import { tap } from 'rxjs/operators';
+import { UserService } from '@service/user.service';
type DiceFormGroup = FormGroup<{
betAmount: FormControl;
--
2.47.2