Sha256: b27bec03ccd54bed613adcf3953561ce97d6dc6792d88c4ad1b5f2ce806e866e

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

import ApplicationController from './application_controller'

/* This is the custom StimulusReflex controller for <%= class_name %>Reflex.
 * Learn more at: https://docs.stimulusreflex.com
 */
export default class extends ApplicationController {
  /* Reflex specific lifecycle methods.
   * Use methods similar to this example to handle lifecycle concerns for a specific Reflex method.
   * Using the lifecycle is optional, so feel free to delete these stubs if you don't need them.
   *
   * Example:
   *
   *   <a href="#" data-reflex="<%= class_name %>Reflex#example">Example</a>
   *
   * Arguments:
   *
   *   element - the element that triggered the reflex
   *             may be different than the Stimulus controller's this.element
   *
   *   reflex - the name of the reflex e.g. "<%= class_name %>Reflex#example"
   *
   *   error - error message from the server
   */

  // beforeUpdate(element, reflex) {
  //  element.innerText = 'Updating...'
  // }

  // updateSuccess(element, reflex) {
  //   element.innerText = 'Updated Successfully.'
  // }

  // updateError(element, reflex, error) {
  //   console.error('updateError', error);
  //   element.innerText = 'Update Failed!'
  // }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
stimulus_reflex-3.2.3 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.2 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.2.pre1 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.2.pre0 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.1 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.0 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.0.pre1 lib/generators/templates/custom_controller.js
stimulus_reflex-3.2.0.pre0 lib/generators/templates/custom_controller.js