Skip to main content

hooks/useSCPreferencesAndFeaturesEnabled

Functions

useSCPreferencesAndFeaturesEnabled()

useSCPreferencesAndFeaturesEnabled(preferences, features): boolean

Custom hook preferences and features at the same time

Parameters

ParameterTypeDefault valueDescription
preferencesstring[]undefinedarray of preference keys
featuresSCFeatureName[][]array of feature keys

Returns

boolean

boolean - true only if all preferences and features are enabled

Ex. const isEnabled = useSCPreferencesAndFeaturesEnabled( [ SCPreferences.CONFIGURATIONS_POST_USER_ADDRESSING_ENABLED, SCPreferences.CONFIGURATIONS_SCHEDULED_POSTS_ENABLED ], [SCFeatureName.TAGGING] );