Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(component-store): add selectSignal signature that combines provided signals #3863

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:

What is the new behavior?

A new signature of the selectSignal function is added. It creates a new signal by combining provided signals:

@Injectable()
class UsersStore extends ComponentStore<State> {
  readonly users = this.selectSignal((s) => s.users);
  readonly query = this.selectSignal((s) => s.query);

  readonly filteredUsers = this.selectSignal(
    this.users,
    this.query,
    (users, query) => users.filter((user) => user.name.includes(query))
  );
}

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@netlify
Copy link

netlify bot commented Apr 29, 2023

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit dcba748
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/644d146c56143d00085717c9
😎 Deploy Preview https://deploy-preview-3863--ngrx-io.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 site settings.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@brandonroberts brandonroberts merged commit 07ba3fa into ngrx:master Apr 29, 2023
@jits
Copy link
Contributor

jits commented May 5, 2023

You guys are on 🔥 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants