-
-
Save kibolho/720f62fdb8b0950f7c7929b4c4fb6a19 to your computer and use it in GitHub Desktop.
SOLID - Open-Closed Principle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const execute= (deeplink:any):void=>{ | |
switch(deeplink.type){ | |
case "home": | |
deeplink.goHome(); | |
case "dashboard": | |
deeplink.goDashboard(); | |
default: | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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