Skip to content

Conversation

@markostanimirovic
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

Closes #4976

Does this PR introduce a breaking change?

[x] Yes
[ ] No
BREAKING CHANGES:

The withEffects feature from @ngrx/signals/events plugin is renamed to withEffectHandlers.

BEFORE:

import { withEffects } from '@ngrx/signals/events';

export const CounterStore = signalStore(
  withState({ count: 0 }),
  withEffects((store, events = inject(Events)) => ({
    logCount$: events.on(increment).pipe(
      tap(() => console.log(store.count()))
    ),
  }))
);

AFTER:

import { withEventHandlers } from '@ngrx/signals/events';

export const CounterStore = signalStore(
  withState({ count: 0 }),
  withEventHandlers((store, events = inject(Events)) => ({
    logCount$: events.on(increment).pipe(
      tap(() => console.log(store.count()))
    ),
  }))
);

BREAKING CHANGES:

The withEffects feature from @ngrx/signals/events plugin is renamed to withEffectHandlers.

BEFORE:

import { withEffects } from '@ngrx/signals/events';

export const CounterStore = signalStore(
  withState({ count: 0 }),
  withEffects((store, events = inject(Events)) => ({
    logCount$: events.on(increment).pipe(
      tap(() => console.log(store.count()))
    ),
  }))
);

AFTER:

import { withEventHandlers } from '@ngrx/signals/events';

export const CounterStore = signalStore(
  withState({ count: 0 }),
  withEventHandlers((store, events = inject(Events)) => ({
    logCount$: events.on(increment).pipe(
      tap(() => console.log(store.count()))
    ),
  }))
);
@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for ngrx-io canceled.

Name Link
🔨 Latest commit 6c66e45
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/6924f959ff65c1000813f875

@netlify
Copy link

netlify bot commented Nov 25, 2025

Deploy Preview for ngrx-site-v19 ready!

Name Link
🔨 Latest commit 6c66e45
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-site-v19/deploys/6924f95ab0e0370008dc39a2
😎 Deploy Preview https://deploy-preview-5009--ngrx-site-v19.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@ngrx/signals/events: Rename withEffects to withEventHandlers

2 participants