survey-creator
survey-creator copied to clipboard
ICreatorPlugin refactoring
It seems to me that these methods
canDeactivateAsync?: (onSuccess: () => void) => void;
defaultAllowingDeactivate?: () => boolean | undefined;
onDesignerSurveyPropertyChanged?: (obj: Base, propName: string) => void;
methods shouldn't be in this interface:
export interface ICreatorPlugin {
activate: () => void;
update?: () => void;
deactivate?: () => boolean;
canDeactivateAsync?: (onSuccess: () => void) => void;
defaultAllowingDeactivate?: () => boolean | undefined;
dispose?: () => void;
onDesignerSurveyPropertyChanged?: (obj: Base, propName: string) => void;
model: Base;
}
We need to apply Interface Segregation Principle here, or combine these methods with the existing ones: canDeactivateAsync and defaultAllowingDeactivate functionality probably can be included in the deactivate method.