withFeature()
does not exist on @ngrx/signals
- angular 19.2.1
#4751
Answered
by
rainerhahnekamp
BarakDabach
asked this question in
Q&A
-
Hi everyone, I tried to follow the docs example like so: import { computed, Signal } from '@angular/core';
import { patchState, signalStore, signalStoreFeature, withComputed, withFeature, withMethods, withState } from '@ngrx/signals';
import { withEntities } from '@ngrx/signals/entities';
export function withBooksFilter(books: Signal<Book[]>) {
return signalStoreFeature(
withState({ query: '' }),
withComputed(({ query }) => ({
filteredBooks: computed(() =>
books().filter((b) => b.name.includes(query()))
),
})),
withMethods((store) => ({
setQuery(query: string): void {
patchState(store, { query });
},
})),
)};
export const BooksStore = signalStore(
withEntities<Book>(),
withFeature(({ entities }) =>
withBooksFilter(entities)
),
); but with no luck were can i found |
Beta Was this translation helpful? Give feedback.
Answered by
rainerhahnekamp
Apr 10, 2025
Replies: 1 comment
-
@BarakDabach, you need to update |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
BarakDabach
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@BarakDabach, you need to update
@ngrx/signals
to the latest version, which is 19.1. Just runng update
and it should show up.