Created
November 24, 2019 06:17
-
-
Save conanak99/1c2c8485b35fe75648470d7e9a06df4c to your computer and use it in GitHub Desktop.
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
function showPages() { | |
// ... Show UI cũ | |
} | |
function showPagesV2() { | |
// Show UI mới, đang code | |
} | |
// Code cũ, trước khi dùng feature flag | |
function showUI() { | |
showPages() // Show UI cũ | |
} | |
// Code mới, sau khi có feature flag | |
function showUI() { | |
// Feature flag tên SHOW_NEW_UI, lưu vào variable | |
const SHOW_NEW_UI = true; | |
if (SHOW_NEW_UI) { | |
showPagesV2() | |
} else { | |
showPages() // Show UI cũ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment