diff options
author | muhamedsalih-tw <104364298+muhamedsalih-tw@users.noreply.github.com> | 2022-11-20 17:35:21 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-20 17:35:21 +0530 |
commit | 86f9ab693dcad951271f727046214b03d91ebd69 (patch) | |
tree | 3d32ff4814b5484495b811c5fe0ebea4805f4e55 /src/features/utils | |
parent | 6.2.1-nightly.47 [skip ci] (diff) | |
download | ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.tar.gz ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.tar.zst ferdium-app-86f9ab693dcad951271f727046214b03d91ebd69.zip |
Transform Todo feature, ServiceBarTargetUrl, ServiceIcon, TeamDashboard, Slider, Loader & WorkspaceSwitchningIndicator into ts (#782)
Diffstat (limited to 'src/features/utils')
-rw-r--r-- | src/features/utils/FeatureStore.ts (renamed from src/features/utils/FeatureStore.js) | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/features/utils/FeatureStore.js b/src/features/utils/FeatureStore.ts index eada332d7..2bdd167f3 100644 --- a/src/features/utils/FeatureStore.js +++ b/src/features/utils/FeatureStore.ts | |||
@@ -1,7 +1,9 @@ | |||
1 | import Reaction from '../../stores/lib/Reaction'; | ||
2 | |||
1 | export default class FeatureStore { | 3 | export default class FeatureStore { |
2 | _actions = []; | 4 | _actions: any = []; |
3 | 5 | ||
4 | _reactions = []; | 6 | _reactions: Reaction[] = []; |
5 | 7 | ||
6 | stop() { | 8 | stop() { |
7 | this._stopActions(); | 9 | this._stopActions(); |
@@ -9,32 +11,38 @@ export default class FeatureStore { | |||
9 | } | 11 | } |
10 | 12 | ||
11 | // ACTIONS | 13 | // ACTIONS |
12 | |||
13 | _registerActions(actions) { | 14 | _registerActions(actions) { |
14 | this._actions = actions; | 15 | this._actions = actions; |
15 | this._startActions(); | 16 | this._startActions(); |
16 | } | 17 | } |
17 | 18 | ||
18 | _startActions(actions = this._actions) { | 19 | _startActions(actions = this._actions) { |
19 | for (const a of actions) a.start(); | 20 | for (const action of actions) { |
21 | action.start(); | ||
22 | } | ||
20 | } | 23 | } |
21 | 24 | ||
22 | _stopActions(actions = this._actions) { | 25 | _stopActions(actions = this._actions) { |
23 | for (const a of actions) a.stop(); | 26 | for (const action of actions) { |
27 | action.stop(); | ||
28 | } | ||
24 | } | 29 | } |
25 | 30 | ||
26 | // REACTIONS | 31 | // REACTIONS |
27 | |||
28 | _registerReactions(reactions) { | 32 | _registerReactions(reactions) { |
29 | this._reactions = reactions; | 33 | this._reactions = reactions; |
30 | this._startReactions(); | 34 | this._startReactions(); |
31 | } | 35 | } |
32 | 36 | ||
33 | _startReactions(reactions = this._reactions) { | 37 | _startReactions(reactions = this._reactions) { |
34 | for (const r of reactions) r.start(); | 38 | for (const reaction of reactions) { |
39 | reaction.start(); | ||
40 | } | ||
35 | } | 41 | } |
36 | 42 | ||
37 | _stopReactions(reactions = this._reactions) { | 43 | _stopReactions(reactions = this._reactions) { |
38 | for (const r of reactions) r.stop(); | 44 | for (const reaction of reactions) { |
45 | reaction.stop(); | ||
46 | } | ||
39 | } | 47 | } |
40 | } | 48 | } |