Skip to content

Instantly share code, notes, and snippets.

@kibolho
Last active July 21, 2021 19:40
Show Gist options
  • Save kibolho/720f62fdb8b0950f7c7929b4c4fb6a19 to your computer and use it in GitHub Desktop.
Save kibolho/720f62fdb8b0950f7c7929b4c4fb6a19 to your computer and use it in GitHub Desktop.
SOLID - Open-Closed Principle
const execute= (deeplink:any):void=>{
switch(deeplink.type){
case "home":
deeplink.goHome();
case "dashboard":
deeplink.goDashboard();
default:
}
}
interface IDeepLink {
go: ()=>void;
}
const execute = (deeplink:IDeepLink):void=>{
deeplink.go()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment