Skip to content

Conversation

ekincia
Copy link
Contributor

@ekincia ekincia commented Feb 9, 2025

Description

Requirements

  • Correct label have been assigned
  • Project has been assigned
  • Milestone has been (created/)assigned

- Update dispatchDataToStore to return Observable<void> instead of Observable<DataType>
- resolves #104

BREAKING CHANGE: dispatchDataToStore now returns Observable<void> instead of
Observable<DataType>. This change enforces SSOT (Single Source of Truth) principle
by requiring users to explicitly subscribe to store selectors to get data.

To migrate:
Before:
dispatchDataToStore(actions, data$, store)
  .pipe(map(data => data.someProperty))

After:
dispatchDataToStore(actions, data$, store)
  .pipe(switchMap(() => store.select(selector)))
- Update store-service.ts to use switchMap after dispatchDataToStore
- Update store-state.service.ts to use switchMap after dispatchDataToStore
- Fix typo in implementation docs
- Update example in implementation docs to show proper SSOT usage

BREAKING CHANGE: dispatchDataToStore now requires switchMap to store
selectors to maintain Single Source of Truth principle
@ekincia ekincia added enhancement New feature or request ngx-store @studiohyperdrive/ngx-store labels Feb 9, 2025
@ekincia ekincia added this to the ngx-store:v20.0.0 milestone Feb 9, 2025
@ekincia ekincia self-assigned this Feb 9, 2025
@ekincia ekincia merged commit a16c713 into master Apr 18, 2025
@ekincia ekincia deleted the feat/store/dispatch-data-to-store-void-return branch April 18, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ngx-store @studiohyperdrive/ngx-store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ngx-store: displatchDataToStore should not return

2 participants