Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created November 24, 2019 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conanak99/1c2c8485b35fe75648470d7e9a06df4c to your computer and use it in GitHub Desktop.
Save conanak99/1c2c8485b35fe75648470d7e9a06df4c to your computer and use it in GitHub Desktop.
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