Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-custom-scroll

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-custom-scroll - npm Package Compare versions

Comparing version 4.1.4 to 4.1.5

2

package.json
{
"name": "react-custom-scroll",
"version": "4.1.4",
"version": "4.1.5",
"description": "An easily designable, cross browser (!!), custom scroll with ReactJS Animations and scroll rate **exactly** like native scroll",

@@ -5,0 +5,0 @@ "main": "index",

@@ -24,4 +24,4 @@ [![NPM version][npm-image]][npm-url]

**From unpkg cdn:**
* [Js file](https://unpkg.com/react-custom-scroll@4.1.4/dist/reactCustomScroll)
* [css file](https://unpkg.com/react-custom-scroll@4.1.4/dist/customScroll.css) 
* [Js file](https://unpkg.com/react-custom-scroll@4.1.5/dist/reactCustomScroll)
* [css file](https://unpkg.com/react-custom-scroll@4.1.5/dist/customScroll.css) 

@@ -28,0 +28,0 @@ Wrap your content with the custom scroll component

import React, { Component, createRef } from 'react'
import reactDOM from 'react-dom'
import styles from './cs.scss'
import { simpleDebounce } from './simpleDebounce'
const simpleDebounce = (func, delay) => {
let timer
function cancel() {
clearTimeout(timer)
}
function debounced() {
cancel()
timer = setTimeout(() => {
func()
}, delay)
}
debounced.cancel = cancel
return debounced
}
const ensureWithinLimits = (value, min, max) => {

@@ -24,0 +7,0 @@ min = !min && min !== 0 ? value : min

export const simpleDebounce = (func, delay) => {
let timer
return function() {
function cancel() {
clearTimeout(timer)
}
function debounced() {
cancel()
timer = setTimeout(() => {

@@ -10,2 +14,5 @@ func()

}
}
debounced.cancel = cancel
return debounced
}

@@ -44,2 +44,14 @@ import {simpleDebounce} from '../main/simpleDebounce'

})
})
it('should cancel scheduled function call on debounced.cancel call', () => {
let counter = 0
const debounced = simpleDebounce(() => counter++, 10)
debounced()
jasmine.clock().tick(5)
debounced.cancel()
jasmine.clock().tick(15)
expect(counter).toEqual(0)
})
})
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