throttleit

WebJar for throttleit

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

throttleit
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

throttleit
WebJar for throttleit
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/component/throttle

Download throttleit

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/throttleit/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>throttleit</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/throttleit/
implementation 'org.webjars.npm:throttleit:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/throttleit/
implementation ("org.webjars.npm:throttleit:1.0.0")
'org.webjars.npm:throttleit:jar:1.0.0'
<dependency org="org.webjars.npm" name="throttleit" rev="1.0.0">
  <artifact name="throttleit" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='throttleit', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "throttleit" % "1.0.0"
[org.webjars.npm/throttleit "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

throttle

Throttle a function

Installation

$ component install component/throttle
$ npm install throttleit

Example

// with component:
var throttle = require('throttle');
// with npm: 
// var throttle = require('throttleit');

window.onresize = throttle(resize, 200);

function resize(e) {
  console.log('height', window.innerHeight);
  console.log('width', window.innerWidth);
}

API

throttle(fn, wait)

Creates a function that will call fn at most once every wait milliseconds.

Supports leading and trailing invocation.

fn will receive last context (this) and last arguments passed to a throttled wrapper before fn was invoked.

License

MIT

org.webjars.npm

Components

modular components for component

Versions

Version
1.0.0
0.0.2