How to use the ember-cli-flash/utils/flash-message-options function in ember-cli-flash

To help you get started, we’ve selected a few ember-cli-flash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github poteto / ember-cli-flash / app / initializers / flash-messages.js View on Github external
export function initialize() {
  const application = arguments[1] || arguments[0];
  const { flashMessageDefaults } = config || {};
  const { injectionFactories } = flashMessageDefaults || [];
  const options = flashMessageOptions(flashMessageDefaults);
  const shouldShowDeprecation = !(injectionFactories && injectionFactories.length);

  deprecate(INJECTION_FACTORIES_DEPRECATION_MESSAGE, shouldShowDeprecation, {
    id: 'ember-cli-flash.deprecate-injection-factories',
    until: '2.0.0'
  });

  options.injectionFactories.forEach((factory) => {
    application.inject(factory, 'flashMessages', 'service:flash-messages');
  });
}