mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
17 lines
515 B
JavaScript
17 lines
515 B
JavaScript
import VisibilityAction from "./action/VisibilityAction";
|
|
import AttributeAction from "./action/AttributeAction";
|
|
|
|
class ActionFactory {
|
|
static make(actionConfig) {
|
|
switch (actionConfig.type) {
|
|
case 'visibility':
|
|
return new VisibilityAction(actionConfig);
|
|
case 'attribute':
|
|
return new AttributeAction(actionConfig);
|
|
}
|
|
|
|
throw new Error('[ActionFactory] Unknown action: ' + actionConfig.type);
|
|
}
|
|
}
|
|
|
|
export default ActionFactory;
|