-
Notifications
You must be signed in to change notification settings - Fork 2
FeatureManager
Doc edited this page Apr 20, 2025
·
1 revision
This class is meant to handle all your features as well as their configuration value from Amaterasu.
Make sure the path to the folder is correct.
import { FeatureManager } from "../tska/event/FeatureManager"This requires an Amaterasu config instance, so you can go ahead and call getConfig
const myManager = new FeatureManager(config.getConfig())Very simple you only need to pass in your desired data with the configName of your feature
const feature = myManager.createFeature("configName", "area", "subArea")Note: This returns a Feature so you can use everything that is in a Feature
In case you ever need to create a Feature without requiring a configName or rather a configValue
myManager.createFeatureNo("area", "subArea")This class also provides a way to register/unregister all of the features within it
myManager.register()
myManager.unregister()-
register/unregisterthe features -
Locationarea/subarea -
registerListenera configuration listener that tells each feature when they should be enabled