component-shipinlv 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,6 +3,7 @@ import './index.less';
3
3
  interface Props {
4
4
  productType: string;
5
5
  port?: number;
6
+ onRunStatus: (runStatus: SubClient.RunStatus) => void;
6
7
  }
7
8
  declare const JoinClient: React.FC<Props>;
8
9
  export default JoinClient;
@@ -1,7 +1,7 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
2
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
- import React, { useRef, useState } from 'react';
4
+ import React, { useEffect, useRef, useState } from 'react';
5
5
  import * as SubClientController from "../service/api/SubClientController";
6
6
  import { useRequest } from '@umijs/hooks';
7
7
  import "./index.less";
@@ -16,7 +16,9 @@ var TryRunStatusIntervalMillisecond = 1000;
16
16
  var JoinClient = function JoinClient(_ref) {
17
17
  var productType = _ref.productType,
18
18
  _ref$port = _ref.port,
19
- port = _ref$port === void 0 ? 0 : _ref$port;
19
+ port = _ref$port === void 0 ? 0 : _ref$port,
20
+ _ref$onRunStatus = _ref.onRunStatus,
21
+ onRunStatus = _ref$onRunStatus === void 0 ? function () {} : _ref$onRunStatus;
20
22
  var _useState = useState('loading'),
21
23
  _useState2 = _slicedToArray(_useState, 2),
22
24
  runStatus = _useState2[0],
@@ -190,6 +192,9 @@ var JoinClient = function JoinClient(_ref) {
190
192
  children: runStatus
191
193
  });
192
194
  };
195
+ useEffect(function () {
196
+ onRunStatus(runStatus);
197
+ }, [runStatus]);
193
198
  return /*#__PURE__*/_jsxs("div", {
194
199
  className: "clientStatus",
195
200
  children: [$status(), /*#__PURE__*/_jsx(Divider, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "component-shipinlv",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",