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

Feature: Add strict state usage #515

Open
grandevel opened this issue Jun 12, 2021 · 0 comments
Open

Feature: Add strict state usage #515

grandevel opened this issue Jun 12, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@grandevel
Copy link
Collaborator

Currently it is possible to 'pollute' state by setting any property without it being first defined - state.blah = ''xxx', either in the root namespace or sub namespaces. Add a config parameter such that properties cannot be added to state when in 'strict mode', unless it is a sub property of an existing state item.

Examle:

const state = {
foo: myObject,
bar: 6
};

state.cheese = 'xxx' would fail/cause an exception
state.foo.cheese = 'xxx' would succeed because it is in a subobject

@grandevel grandevel added the bug Something isn't working label Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants