Marionette Features are opt-in functionality that you can enable by utilizing setEnabled in your app.
It is a good practice to set these flags only once prior to instantiating any Marionette class.
Use isEnabled if you need to know the state of a feature flag programmatically.
import { isEnabled } from 'backbone.marionette';
isEnabled('fooFlag'); // false
Use setEnabled to change the value of a flag.
While setting a flag at any point may work, these flags are designed to be set before
any functionality of Marionette is used. Change flags after at your own risk.
import { setEnabled } from 'backbone.marionette';
setEnabled('fooFlag', true);
const myApp = new MyApp({
region: '#app-hook'
});
myApp.start();
childViewEventPrefixDefault: false
This flag indicates whether childViewEventPrefix
for all views will return the default value of 'childview' or if it will return false
disabling automatic event bubbling.
triggersPreventDefaultDefault: true
It indicates the whether or not View.triggers will call event.preventDefault() if not explicitly defined by the trigger.
The default has been true, but for a future version false is being considered.
triggersStopPropagatingDefault: true
It indicates the whether or not View.triggers will call event.stopPropagating() if not explicitly defined by the trigger.
The default has been true, but for a future version false is being considered.
Default: false
If true, deprecation console warnings are issued at runtime.