UNPKG

@cainiaofe/cn-ui-charts

Version:
17 lines (15 loc) 389 B
import { useEffect, useState } from 'react' import {componentLoopMap} from "@/common/manager/feature"; export default function useStopLoop(options){ const { _nodeId } = options || {} useEffect(()=>{ return ()=>{ if(_nodeId) { const loopId = componentLoopMap[_nodeId] if(typeof loopId === 'number') { clearInterval(loopId) } } } },[]) }