angular-architects / ngrx-toolkit

Various Extensions for the NgRx Signal Store
MIT License
177 stars 23 forks source link

Devtools Issue #77

Closed rainerhahnekamp closed 3 months ago

rainerhahnekamp commented 3 months ago

Devtools seem to return an incompatible SignalStoreFeature:

https://stackblitz.com/~/github.com/simon-boskovic/signalStoreFeature?file=src/app/app.component.ts

See also: https://github.com/ngrx/platform/issues/4475

FYI: @simon-boskovic

rainerhahnekamp commented 3 months ago

@simon-boskovic it was not an issue with the devtools but of the custom features.

As soon as you have a condition like

export function withCommonFeature() {
  return signalStoreFeature(
    { state: type<AppState>() },
    withMethods((store) => ({
      addSection() {},
    }))
  );
}

you have to

export function withCommonFeature<_>() { // <-- the <_> is important
  return signalStoreFeature(
    { state: type<AppState>() },
    withMethods((store) => ({
      addSection() {},
    }))
  );
}

It is described here: https://ngrx.io/guide/signals/signal-store/custom-store-features#known-typescript-issues