1
0
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:
Janne Savolainen 2022-05-25 10:56:27 +03:00
parent 0c7c851c66
commit 8217ca8883
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -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);
});
},
});