Sha256: 0b8f357793ce986a8494a9cd3d7e93584e38e3cd979a30f29139907f40043994

Contents?: true

Size: 775 Bytes

Versions: 32

Compression:

Stored size: 775 Bytes

Contents

!(angular => {
  'use strict';

  class Spinner {

    constructor(context) {
      this.context = context;
      this.active = false;
    }

    on() {
      this.active = true;
    }

    off() {
      this.active = false;
    }
  }

  class SpinnerState {
    constructor() {
      this._spinnersMap = {};
    }

    withContext(context) {
      if (!_.has(this._spinnersMap, context))  {
        this._spinnersMap[context] = new Spinner(context);
      }

      return this._spinnersMap[context];
    }

    isActive() {
      return _.some(this._spinners(), spinner => spinner.active );
    }

    _spinners() {
      return _.values(this._spinnersMap);
    }

  }

  angular.module('alephServices.spinnerState', []).service('SpinnerState', SpinnerState);

}(angular));

Version data entries

32 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.4.8 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.8 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.4.7 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.4.7 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.4 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.4 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.4.2 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.2 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.4.1 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.4.1 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.3.0 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.3.0 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.2.0 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.2.0 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.1.0 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.1.0 app/assets/javascripts/angular/services/lib/spinner_state.js.es6
aleph_analytics-0.0.6 public/assets/angular/services/lib/spinner_state.js-315bb62df18f9370a89f8b865eb1766a.es6
aleph_analytics-0.0.6 app/assets/javascripts/angular/services/lib/spinner_state.js.es6