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,storeconfig): config for deepFreeze function #209

Merged
merged 2 commits into from Apr 17, 2019

Conversation

orangeswim
Copy link
Contributor

Adds deepFreezeFunction in StoreConfigOptions and unit tests for feature
Can use custom deepFreeze for complex objects in store

Resolves #124

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 current behavior?

Objects in store are frozen with deepFreeze on _setState. Complex states or entities might break when frozen (like moment.js) during development.

Issue Number: #124

What is the new behavior?

User can now add a custom deepFreeze function to dictate Freezing behavior during development.

Does this PR introduce a breaking change?

[ ] Yes
[X ] No

Other information

Also added a simple unit test for deepFreeze function. Where do I update docs?

Adds deepFreezeFunction in StoreConfigOptions and unit tests for feature
Can use custom deepFreeze for complex objects in store

Resolves salesforce#124
Copy link
Collaborator

@NetanelBasal NetanelBasal left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -4,6 +4,7 @@ export type StoreConfigOptions = {
idKey?: string;
storeName?: string;
cache?: { ttl: number };
deepFreezeFunction?: (o: any) => any;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you change it to deepFreezeFn, please?

@NetanelBasal NetanelBasal merged commit 87c1418 into salesforce:master Apr 17, 2019
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.

Akita deep freeze is conflicting with moment.js date formatting logic (notably with mat-datepicker)
2 participants