From c5e312dfb6d41044934af3938509d533ae2e5517 Mon Sep 17 00:00:00 2001 From: Saul Date: Tue, 27 Feb 2024 08:18:08 +0100 Subject: [PATCH] fix: avoid testing cleanup issue --- package.json | 42 +++++++++---------- .../ngrx-rtk-query/src/lib/build-hooks.ts | 3 -- .../ngrx-rtk-query/src/lib/thunk.service.ts | 12 ++---- 3 files changed, 24 insertions(+), 33 deletions(-) diff --git a/package.json b/package.json index fab7689..b1e81b9 100644 --- a/package.json +++ b/package.json @@ -28,36 +28,36 @@ }, "private": true, "dependencies": { - "@angular/animations": "~17.2.1", - "@angular/common": "~17.2.1", - "@angular/compiler": "~17.2.1", - "@angular/core": "~17.2.1", - "@angular/forms": "~17.2.1", - "@angular/platform-browser": "~17.2.1", - "@angular/platform-browser-dynamic": "~17.2.1", - "@angular/router": "~17.2.1", + "@angular/animations": "~17.2.2", + "@angular/common": "~17.2.2", + "@angular/compiler": "~17.2.2", + "@angular/core": "~17.2.2", + "@angular/forms": "~17.2.2", + "@angular/platform-browser": "~17.2.2", + "@angular/platform-browser-dynamic": "~17.2.2", + "@angular/router": "~17.2.2", "@ngneat/lib": "~5.0.0", - "@ngrx/effects": "17.1.0", - "@ngrx/router-store": "17.1.0", - "@ngrx/store": "17.1.0", + "@ngrx/effects": "17.1.1", + "@ngrx/router-store": "17.1.1", + "@ngrx/store": "17.1.1", "@reduxjs/toolkit": "~2.2.1", "rxjs": "~7.8.1", "tslib": "~2.6.2", "zone.js": "~0.14.4" }, "devDependencies": { - "@angular-builders/jest": "~17.0.1", - "@angular-devkit/build-angular": "~17.2.0", + "@angular-builders/jest": "~17.0.2", + "@angular-devkit/build-angular": "~17.2.1", "@angular-eslint/builder": "~17.2.1", "@angular-eslint/eslint-plugin": "~17.2.1", "@angular-eslint/eslint-plugin-template": "~17.2.1", "@angular-eslint/schematics": "~17.2.1", "@angular-eslint/template-parser": "~17.2.1", - "@angular/cli": "~17.2.0", - "@angular/compiler-cli": "~17.2.1", + "@angular/cli": "~17.2.1", + "@angular/compiler-cli": "~17.2.2", "@commitlint/cli": "^18.6.1", "@commitlint/config-conventional": "^18.6.2", - "@ngrx/store-devtools": "17.1.0", + "@ngrx/store-devtools": "17.1.1", "@semantic-release/changelog": "^6.0.3", "@semantic-release/git": "^10.0.1", "@tailwindcss/forms": "^0.5.7", @@ -66,7 +66,7 @@ "@testing-library/user-event": "^14.5.2", "@types/events": "^3.0.3", "@types/jest": "^29.5.12", - "@types/node": "^18.19.16", + "@types/node": "^18.19.18", "@types/node-fetch": "^2.6.11", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", @@ -74,22 +74,22 @@ "angular-cli-ghpages": "1.0.7", "cpx": "^1.5.0", "cross-env": "^7.0.3", - "eslint": "^8.56.0", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jest": "^27.8.0", + "eslint-plugin-jest": "^27.9.0", "eslint-plugin-jest-dom": "^5.1.0", "eslint-plugin-jsdoc": "^48.1.0", "eslint-plugin-ngrx": "^2.1.4", "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-prettier": "^5.1.3", "eslint-plugin-rxjs": "^5.0.3", - "eslint-plugin-tailwindcss": "^3.14.2", + "eslint-plugin-tailwindcss": "^3.14.3", "eslint-plugin-testing-library": "^6.2.0", "git-cz": "^4.9.0", "husky": "^9.0.11", "jest": "^29.7.0", - "jest-preset-angular": "~14.0.2", + "jest-preset-angular": "~14.0.3", "jsonc-parser": "^3.2.1", "lint-staged": "^15.2.2", "msw": "^1.3.2", diff --git a/projects/ngrx-rtk-query/src/lib/build-hooks.ts b/projects/ngrx-rtk-query/src/lib/build-hooks.ts index 7c42741..61fb77b 100644 --- a/projects/ngrx-rtk-query/src/lib/build-hooks.ts +++ b/projects/ngrx-rtk-query/src/lib/build-hooks.ts @@ -38,9 +38,6 @@ import type { import { useStableQueryArgs } from './useSerializedStableValue'; import { shallowEqual } from './utils'; -// const defaultQueryStateSelector: QueryStateSelector = (x) => x; -//const defaultMutationStateSelector: MutationStateSelector = (x) => x; - /** * Wrapper around `defaultQueryStateSelector` to be used in `useQuery`. * We want the initial render to already come back with diff --git a/projects/ngrx-rtk-query/src/lib/thunk.service.ts b/projects/ngrx-rtk-query/src/lib/thunk.service.ts index 05c0287..34fc0f1 100644 --- a/projects/ngrx-rtk-query/src/lib/thunk.service.ts +++ b/projects/ngrx-rtk-query/src/lib/thunk.service.ts @@ -5,10 +5,6 @@ import type { SelectSignalOptions } from '@ngrx/store/src/models'; let service: ThunkService; export let injector: Injector; -/* export const internalBatchState: InternalMiddlewareState = { - currentSubscriptions: {}, -}; */ - export function dispatch(action: Action) { service?.dispatch(action); return action; @@ -28,11 +24,9 @@ export class ThunkService { readonly #store = inject(Store); init() { - if (!service) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - service = this; - injector = this.#injector; - } + // eslint-disable-next-line @typescript-eslint/no-this-alias + service = this; + injector = this.#injector; } getState = this.#store.selectSignal((state) => state);