Replies: 3 comments 1 reply
-
Looks like I can define a store as a class, which solves this need. Example: type AuthState = { user: User | null };
const _AuthStore = signalStore(
{ providedIn: 'root' },
withState<AuthState>({ user: null })
);
@Injectable({ providedIn: 'root' })
export class AuthStore extends _AuthStore {
// Add any extra properties etc. here
} |
Beta Was this translation helpful? Give feedback.
0 replies
-
What would be a use case where SignalStore should have additional properties that are not methods or computed signals? |
Beta Was this translation helpful? Give feedback.
1 reply
-
If we can extend a class and put our signals and methods over there, what are the benefits of using the signal store features, withComputed and withMethods? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to add extra properties and internal methods on the store instance?
This is one of the really useful things about ComponentStore: since it's a class you can add anything (public, protected or private) and use it internally or externally.
Beta Was this translation helpful? Give feedback.
All reactions