feat: more clean hot hookz

This commit is contained in:
Ivan Shmidt
2020-06-15 22:36:36 +02:00
parent 9fe15e6726
commit 417a4d538e
3 changed files with 66 additions and 25 deletions
+3 -2
View File
@@ -24,7 +24,7 @@ import {
runPeriodically,
} from '@backstage/plugin-catalog-backend';
import { PluginEnvironment } from '../types';
import { useHotEffect } from '@backstage/backend-common';
import { useHotCleanup } from '@backstage/backend-common';
export default async function createPlugin({
logger,
@@ -42,7 +42,8 @@ export default async function createPlugin({
logger,
);
useHotEffect(module, () =>
useHotCleanup(
module,
runPeriodically(() => higherOrderOperation.refreshAllLocations(), 10000),
);