Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.