From a3682e8e5e5c95bbd548c614a5b14623254342bf Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Fri, 20 Dec 2024 02:38:56 -0800 Subject: [PATCH] chore: remove hacky fix to Angular Redux --- package.json | 5 +++-- pnpm-lock.yaml | 10 +++++----- src/app/app.component.ts | 6 ++---- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a5ced8c..3fe68cf 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "start": "ng serve", "build": "ng build", "watch": "ng build --watch --configuration development", - "tauri": "tauri" + "tauri": "tauri", + "tauri:dev": "pnpm tauri dev" }, "private": true, "dependencies": { @@ -18,7 +19,7 @@ "@angular/platform-browser": "^19.0.0", "@angular/platform-browser-dynamic": "^19.0.0", "@angular/router": "^19.0.0", - "@reduxjs/angular-redux": "^2.0.0", + "@reduxjs/angular-redux": "^2.0.1", "@reduxjs/toolkit": "^2.5.0", "@tanstack/angular-query-experimental": "^5.62.7", "@tauri-apps/api": "^2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eb97d06..bcc9790 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: ^19.0.0 version: 19.0.4(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(@angular/platform-browser@19.0.4(@angular/animations@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0)))(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0)))(rxjs@7.8.1) '@reduxjs/angular-redux': - specifier: ^2.0.0 - version: 2.0.0(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(@reduxjs/toolkit@2.5.0)(redux@5.0.1) + specifier: ^2.0.1 + version: 2.0.1(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(@reduxjs/toolkit@2.5.0)(redux@5.0.1) '@reduxjs/toolkit': specifier: ^2.5.0 version: 2.5.0 @@ -999,8 +999,8 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@reduxjs/angular-redux@2.0.0': - resolution: {integrity: sha512-Q/mNESkeKykd9dFoopupj9WOrkoVCfnBR4jkgW1pCOfyy/JUAqStqEeLO48qDi/d3Z+H12awl1kaJMHpp9zoaw==} + '@reduxjs/angular-redux@2.0.1': + resolution: {integrity: sha512-BEXV7ekSAc8z0yI78omPd58/a9ZQ7v2c+B4I39ZXDt/HdogYsBQFC4Qbdb6bRKncleDOxdoCsYQ6n7KAdKMlHA==} peerDependencies: '@angular/common': '>=19.0.0' '@angular/core': '>=19.0.0' @@ -3166,7 +3166,7 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@reduxjs/angular-redux@2.0.0(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(@reduxjs/toolkit@2.5.0)(redux@5.0.1)': + '@reduxjs/angular-redux@2.0.1(@angular/common@19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1))(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(@reduxjs/toolkit@2.5.0)(redux@5.0.1)': dependencies: '@angular/common': 19.0.4(@angular/core@19.0.4(rxjs@7.8.1)(zone.js@0.15.0))(rxjs@7.8.1) '@angular/core': 19.0.4(rxjs@7.8.1)(zone.js@0.15.0) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 82452c3..b0d6873 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,4 +1,4 @@ -import {Component, effect, untracked} from '@angular/core'; +import {Component, effect} from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterOutlet } from '@angular/router'; import { injectDispatch, injectSelector } from "@reduxjs/angular-redux"; @@ -21,9 +21,7 @@ export class App { dispatch = injectDispatch(); _musicSync = effect((onCleanup) => { - // TODO: Without this, the effect is running over and over and over again despite not changing. IDK why. - // TODO: Debug this in Angular Redux - untracked(() => this.dispatch(musicSync())); + this.dispatch(musicSync()); // Listen for the server to tell us to sync the music player, like when the song changes or song is paused let unlisten = () => { }; -- 2.51.2