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(store): remove forbidden chars and empty str checks from createActionGroup #3857

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)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

There will be a compilation error if we try to define actions whose names contain only empty spaces or forbidden characters:

const myActionGroup = createActionGroup({
  source: 'My Actions',
  events: {
    '': emptyProps(),
    '+-*': emptyProps(),
  }
});

What is the new behavior?

There is no compilation error in the example above. The myActionGroup object will contain the following action creators:

store.dispatch(myActionGroup['']());

store.dispatch(myActionGroup['+-*']());

The main reason for removing these checks is that we can never forbid all the characters we want. For example, it's possible with the current implementation to use letters from Greek Alphabet or Serbian Cyrillic when defining event names.

This change also simplifies implementation and reduces CI time for type tests.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@netlify
Copy link

netlify bot commented Apr 26, 2023

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 6e40f0c
🔍 Latest deploy log https://app.netlify.com/sites/ngrx-io/deploys/64486a3fbe8549000845a160
😎 Deploy Preview https://deploy-preview-3857--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.

@markostanimirovic markostanimirovic merged commit e37c57b into ngrx:master Apr 26, 2023
6 checks passed
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.

None yet

3 participants