feat: added persisted Switchers for better resource utilization #215
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



This pull request introduces several improvements and refactors to the Switcher Client JS SDK, focusing on simplifying the API for checking feature flags, improving switcher instance management, and updating documentation and tests accordingly. The main highlights are the refactoring of the
SwitcherAPI to allow calling methods without explicitly passing a feature key each time, the introduction of persisted switcher instances in theClient, and comprehensive updates to documentation and tests to reflect these changes.API Refactoring and Simplification
Switchermethods (isItOn,isItOnBool,isItOnDetail) so that once a switcher is obtained with a key (e.g.,Client.getSwitcher('FEATURE01')), subsequent calls to these methods no longer require the key to be passed as an argument. This results in cleaner and less error-prone code.Switcher Instance Management
Client.getSwitcher(key). When a switcher is requested with a key, the same instance is returned for subsequent requests with the same key, ensuring consistency and potentially improving performance. [1] [2]Documentation and Dependency Updates
README.mdto clarify the new API usage and terminology, including the distinction between persisted and non-persisted switcher instances. [1] [2] [3]package.jsonfor improved linting support.