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