LoadingReactiveVar.js
2 years ago
ReactiveHook.js
2 years ago
ReactiveSet.js
2 years ago
ReactiveVar.js
2 years ago
LoadingReactiveVar.js
24 lines
| 1 | /** |
| 2 | * @this {ReactiveVar} |
| 3 | * |
| 4 | * @constructor |
| 5 | */ |
| 6 | import ReactiveVar from './ReactiveVar'; |
| 7 | |
| 8 | function LoadingReactiveVar() { |
| 9 | ReactiveVar.call( this, false ); |
| 10 | |
| 11 | this.start = function () { |
| 12 | this.current = true; |
| 13 | }; |
| 14 | this.end = function () { |
| 15 | this.current = false; |
| 16 | }; |
| 17 | this.toggle = function () { |
| 18 | this.current = !this.current; |
| 19 | }; |
| 20 | } |
| 21 | |
| 22 | LoadingReactiveVar.prototype = Object.create( ReactiveVar.prototype ); |
| 23 | |
| 24 | export default LoadingReactiveVar; |