Skip to content

Instantly share code, notes, and snippets.

@yuanmai
Last active August 29, 2015 13:57
Show Gist options
  • Save yuanmai/9756430 to your computer and use it in GitHub Desktop.
Save yuanmai/9756430 to your computer and use it in GitHub Desktop.

Feature Toggle

$(document).one('feature-a', '#some-id', function() {
  $(document).on('some-event', '#some-ids', handler);
});

//Turn on feature a
$('#a, #b').trigger('feature-a');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment