File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
packages/node_modules/overmind/src Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -227,6 +227,8 @@ export type ActionCallback<App> = (action: TActionCreator<App>) => any
227227 CLASS TYPES
228228*/
229229
230+ const hotReloadingCache = { }
231+
230232export default class App <
231233 Config extends Configuration ,
232234 EvalConfig extends TConfig < Config >
@@ -245,6 +247,13 @@ export default class App<
245247 }
246248 state : EvalConfig [ 'state' ]
247249 constructor ( configuration : Config , options : Options = { } ) {
250+ const name = options . name || 'MyApp'
251+
252+ if ( hotReloadingCache [ name ] ) {
253+ return hotReloadingCache [ name ]
254+ } else {
255+ hotReloadingCache [ name ] = this
256+ }
248257 /*
249258 Mutate module functions into module objects
250259 */
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export type SubType<Base, Condition> = Pick<
1616>
1717
1818export type Options = {
19+ name ?: string
1920 devtools ?: string
2021}
2122
You can’t perform that action at this time.
0 commit comments