mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
19 lines
464 B
JavaScript
19 lines
464 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;
|