rc-countdown-view
Advanced tools
+8
-15
@@ -12,8 +12,4 @@ "use strict"; | ||
| var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
| var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
| var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties")); | ||
| var _react = _interopRequireWildcard(require("react")); | ||
@@ -41,4 +37,3 @@ | ||
| _ref$onEnd = _ref.onEnd, | ||
| onEnd = _ref$onEnd === void 0 ? noop : _ref$onEnd, | ||
| restProps = (0, _objectWithoutProperties2["default"])(_ref, ["time", "interval", "format", "autoStart", "onChange", "onEnd"]); | ||
| onEnd = _ref$onEnd === void 0 ? noop : _ref$onEnd; | ||
@@ -75,8 +70,8 @@ var formatTime = (0, _react.useCallback)(function (time) { | ||
| }, [time, interval, format]); | ||
| (0, _react.useEffect)(function () { | ||
| if (ref && ref.current) { | ||
| ref.current.start = countdown.start.bind(countdown); | ||
| ref.current.pause = countdown.pause.bind(countdown); | ||
| ref.current.reset = countdown.reset.bind(countdown); | ||
| } | ||
| (0, _react.useImperativeHandle)(ref, function () { | ||
| return { | ||
| start: countdown.start.bind(countdown), | ||
| pause: countdown.pause.bind(countdown), | ||
| reset: countdown.reset.bind(countdown) | ||
| }; | ||
| }, [ref]); | ||
@@ -92,5 +87,3 @@ (0, _react.useEffect)(function () { | ||
| }, []); | ||
| return /*#__PURE__*/_react["default"].createElement("span", (0, _extends2["default"])({ | ||
| ref: ref | ||
| }, restProps), timeState); | ||
| return timeState; | ||
| }); | ||
@@ -97,0 +90,0 @@ |
+1
-1
| { | ||
| "name": "rc-countdown-view", | ||
| "version": "1.0.1", | ||
| "version": "1.1.0", | ||
| "description": "A simple countdown react component.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
+1
-1
@@ -22,3 +22,3 @@ # rc-countdown-view | ||
| export default ()=>{ | ||
| export default () => { | ||
| return ( | ||
@@ -25,0 +25,0 @@ <CountDown time={10 * 60 * 60 * 1000} /> |
5398
-8.23%79
-5.95%