mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove duplication for disposers
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com> Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
1 parent
0c7c851c66
commit
8217ca8883
1 file changed
+2
-5
@@ -6,6 +6,7 @@ import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { getStartableStoppable } from "../utils/get-startable-stoppable";
|
||||
import { channelListenerInjectionToken } from "./channel-listener-injection-token";
|
||||
import { enlistChannelListenerInjectionToken } from "./enlist-channel-listener-injection-token";
|
||||
import { disposer } from "../utils";
|
||||
|
||||
const listeningOfChannelsInjectable = getInjectable({
|
||||
id: "listening-of-channels",
|
||||
@@ -19,11 +20,7 @@ const listeningOfChannelsInjectable = getInjectable({
|
||||
enlistChannelListener(channel, handler),
|
||||
);
|
||||
|
||||
return () => {
|
||||
disposers.forEach((disposer) => {
|
||||
disposer();
|
||||
});
|
||||
};
|
||||
return disposer(...disposers);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user