Skip to content

Commit

Permalink
fix(设备模拟器): 设备模拟器详情
Browse files Browse the repository at this point in the history
定时5秒查询数据

re #203
  • Loading branch information
Lind-pro committed Sep 24, 2020
1 parent e91d298 commit 1c85cd8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/pages/simulator/device/detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ const Detail: React.FC<Props> = props => {

const [data, setData] = useState<any>({});
useEffect(() => {
service.state(props.data.id).pipe(
).subscribe(data => {
setData(data);
});
const requestData = setInterval(() => {
service.state(props.data.id).pipe(
).subscribe(data => {
setData(data);
});
}, 5000);
return () => {
clearInterval(requestData);
}
}, []);
return (
<Modal
Expand Down

0 comments on commit 1c85cd8

Please sign in to comment.