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(plugin-status): ✨ enhance store status plugin and improve naming #78

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

zuriscript
Copy link
Owner

@zuriscript zuriscript commented Jan 15, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

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
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

The current behavior of the Store Status Plugin involves tracking the loading and modification status of a store.

We've recognized a need for a clearer distinction between modification and initialization. In numerous scenarios, it's essential to determine if a store has been initialized, especially after a backend call or side effect. The existing isModified function is not ideal for this purpose.

Additionally, the naming of isModified, has been identified as potentially misleading. While isModified is intended to indicate whether the store has been modified, it may be interpreted as an ongoing process.

What is the new behavior?

The initialized function determines if a store has been initialized, making it particularly useful after backend calls or side effects.

isModified has been renamed to modified. These aligns well with the new initialized signal and aims to enhance code readability in conditionals.

Additionally, the deprecated markAsUnmodified function is replaced with the more comprehensive resetStoreStatus, allowing for manual resetting of both initialization and modification statuses.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

  • Rename setUnmodifiedStatus to setInitializedStatus in effects.
  • Introduce initialized() function to track store initialization status.
  • Introduce resetStoreStatus() to manually reset store status.

Deprecation:

  • Deprecate isModified(), use modified() instead.
  • Deprecate markAsUnmodified(), use resetStoreStatus() instead.

- Rename setUnmodifiedStatus to setInitializedStatus in effects.

- Introduce initialized() function to track store initialization status.

- Introduce resetStoreStatus() to manually reset store status.

- Deprecate isModified(), use modified() instead.

- Deprecate markAsUnmodified(), use resetStoreStatus() instead.
@zuriscript zuriscript merged commit a3b74ef into master Jan 15, 2024
1 check passed
@zuriscript zuriscript deleted the feature/improve-store-status-plugin branch January 15, 2024 22:44
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.

1 participant