Socket
Socket
Sign inDemoInstall

react-compound-timer

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-compound-timer - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

69

build/components/Timer/Timer.js

@@ -69,3 +69,3 @@ 'use strict';

return _react2.default.createElement(
TimerContext.Consumer,
Timer.Consumer,
null,

@@ -81,3 +81,3 @@ function (_ref) {

return _react2.default.createElement(
TimerContext.Consumer,
Timer.Consumer,
null,

@@ -93,3 +93,3 @@ function (_ref2) {

return _react2.default.createElement(
TimerContext.Consumer,
Timer.Consumer,
null,

@@ -105,3 +105,3 @@ function (_ref3) {

return _react2.default.createElement(
TimerContext.Consumer,
Timer.Consumer,
null,

@@ -117,3 +117,3 @@ function (_ref4) {

return _react2.default.createElement(
TimerContext.Consumer,
Timer.Consumer,
null,

@@ -180,2 +180,22 @@ function (_ref5) {

}, {
key: 'setTime',
value: function setTime(time) {
this.timer.setTime(time);
}
}, {
key: 'getTime',
value: function getTime() {
return this.timer.getTime();
}
}, {
key: 'setDirection',
value: function setDirection(direction) {
this.timer.setDirection(direction);
}
}, {
key: 'setCheckpoints',
value: function setCheckpoints(checkpoints) {
this.timer.setCheckpoints(checkpoints);
}
}, {
key: 'start',

@@ -188,7 +208,7 @@ value: function start() {

}, {
key: 'resume',
value: function resume() {
this.timer.resume();
key: 'stop',
value: function stop() {
this.timer.stop();
this.props.onResume();
this.props.onStop();
}

@@ -203,9 +223,2 @@ }, {

}, {
key: 'stop',
value: function stop() {
this.timer.stop();
this.props.onStop();
}
}, {
key: 'reset',

@@ -218,22 +231,9 @@ value: function reset() {

}, {
key: 'setTime',
value: function setTime(time) {
this.timer.setTime(time);
key: 'resume',
value: function resume() {
this.timer.resume();
this.props.onResume();
}
}, {
key: 'getTime',
value: function getTime() {
return this.timer.getTime();
}
}, {
key: 'setDirection',
value: function setDirection(direction) {
this.timer.setDirection(direction);
}
}, {
key: 'setCheckpoints',
value: function setCheckpoints(checkpoints) {
this.timer.setCheckpoints(checkpoints);
}
}, {
key: 'render',

@@ -307,2 +307,3 @@ value: function render() {

Timer.Consumer = TimerContext.Consumer;
Timer.Milliseconds = Milliseconds;

@@ -309,0 +310,0 @@ Timer.Seconds = Seconds;

@@ -230,1 +230,35 @@ ### Forward Count

```
### Use Timer.Consumer
```jsx
const withTimer = timerProps => WrappedComponent => wrappedComponentProps => (
<Timer {...timerProps}>
{timerRenderProps =>
<WrappedComponent {...wrappedComponentProps} timer={timerRenderProps} />}
</Timer>
);
class TimerWrapper extends React.Component {
shouldComponentUpdate() {
return false;
}
render() {
return (
<div>
<div>Simple text</div>
<Timer.Consumer>
{() => this.props.timer.getTime()}
</Timer.Consumer>
</div>
);
}
}
const TimerHOC = withTimer({
initialTime: 5000,
})(TimerWrapper);
<TimerHOC />
```
{
"name": "react-compound-timer",
"version": "1.0.5",
"version": "1.0.6",
"description": "Timer compound react component",

@@ -5,0 +5,0 @@ "main": "build/components/Timer/Timer",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc