1 | import createDebug from 'debug';
|
2 | import Reflux from 'reflux';
|
3 | const debug = createDebug('hadron-app-registry:actions');
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const actionDeregistered = Reflux.createAction({
|
9 | |
10 |
|
11 |
|
12 |
|
13 |
|
14 | preEmit: function (name: string) {
|
15 | debug(`Action ${name} deregistered.`);
|
16 | },
|
17 | });
|
18 |
|
19 |
|
20 |
|
21 |
|
22 | const actionRegistered = Reflux.createAction({
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 | preEmit: function (name: string) {
|
29 | debug(`Action ${name} registered.`);
|
30 | },
|
31 | });
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | const actionOverridden = Reflux.createAction({
|
37 | |
38 |
|
39 |
|
40 |
|
41 |
|
42 | preEmit: function (name: string) {
|
43 | debug(`Action ${name} overwrote existing action in the registry.`);
|
44 | },
|
45 | });
|
46 |
|
47 |
|
48 |
|
49 |
|
50 | const componentDeregistered = Reflux.createAction({
|
51 | |
52 |
|
53 |
|
54 |
|
55 |
|
56 | preEmit: function (name: string) {
|
57 | debug(`Component ${name} deregistered.`);
|
58 | },
|
59 | });
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | const componentRegistered = Reflux.createAction({
|
65 | |
66 |
|
67 |
|
68 |
|
69 |
|
70 | preEmit: function (name: string) {
|
71 | debug(`Component ${name} registered.`);
|
72 | },
|
73 | });
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | const containerDeregistered = Reflux.createAction({
|
79 | |
80 |
|
81 |
|
82 |
|
83 |
|
84 | preEmit: function (name: string) {
|
85 | debug(`Container ${name} deregistered.`);
|
86 | },
|
87 | });
|
88 |
|
89 |
|
90 |
|
91 |
|
92 | const containerRegistered = Reflux.createAction({
|
93 | |
94 |
|
95 |
|
96 |
|
97 |
|
98 | preEmit: function (name: string) {
|
99 | debug(`Container ${name} registered.`);
|
100 | },
|
101 | });
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | const componentOverridden = Reflux.createAction({
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 | preEmit: function (name: string) {
|
113 | debug(`Component ${name} overwrote existing component in the registry.`);
|
114 | },
|
115 | });
|
116 |
|
117 |
|
118 |
|
119 |
|
120 | const roleDeregistered = Reflux.createAction({
|
121 | |
122 |
|
123 |
|
124 |
|
125 |
|
126 | preEmit: function (name: string) {
|
127 | debug(`Role ${name} deregistered.`);
|
128 | },
|
129 | });
|
130 |
|
131 |
|
132 |
|
133 |
|
134 | const roleRegistered = Reflux.createAction({
|
135 | |
136 |
|
137 |
|
138 |
|
139 |
|
140 | preEmit: function (name: string) {
|
141 | debug(`Role ${name} registered.`);
|
142 | },
|
143 | });
|
144 |
|
145 |
|
146 |
|
147 |
|
148 | const storeDeregistered = Reflux.createAction({
|
149 | |
150 |
|
151 |
|
152 |
|
153 |
|
154 | preEmit: function (name: string) {
|
155 | debug(`Store ${name} deregistered.`);
|
156 | },
|
157 | });
|
158 |
|
159 |
|
160 |
|
161 |
|
162 | const storeRegistered = Reflux.createAction({
|
163 | |
164 |
|
165 |
|
166 |
|
167 |
|
168 | preEmit: function (name: string) {
|
169 | debug(`Store ${name} registered.`);
|
170 | },
|
171 | });
|
172 |
|
173 |
|
174 |
|
175 |
|
176 | const storeOverridden = Reflux.createAction({
|
177 | |
178 |
|
179 |
|
180 |
|
181 |
|
182 | preEmit: function (name: string) {
|
183 | debug(`Store ${name} overwrote existing store in the registry.`);
|
184 | },
|
185 | });
|
186 |
|
187 | export const Actions = {
|
188 | actionDeregistered,
|
189 | actionRegistered,
|
190 | actionOverridden,
|
191 | componentDeregistered,
|
192 | componentRegistered,
|
193 | componentOverridden,
|
194 | containerDeregistered,
|
195 | containerRegistered,
|
196 | roleDeregistered,
|
197 | roleRegistered,
|
198 | storeDeregistered,
|
199 | storeRegistered,
|
200 | storeOverridden,
|
201 | };
|