New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bi-cycle

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bi-cycle

Bi-cycle assists in making infinite carousels and sliders by handling the index logic for you.

  • 0.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-28.57%
Maintainers
1
Weekly downloads
 
Created
Source

Bi-cycle

Bi-cycle assists in making infinite carousels and sliders by handling the index logic for you.

Travis   npm   License MIT

npm: npm i bi-cycle

Source: SketchedOut

Getting Started

Bi-cycle uses generators and provides an interface to modify the immutable index.

import Bicycle from 'bi-cycle';
const { next } = Bicycle();

// ...

nextButton.addEventListener('click', next);

You can destructure a handful of functions — first, previous, next, last — for traversing the generator — each invocation to Bicycle will yield a new generator and therefore you can quite easily have multiple instances. You can also use current to determine the current index, and goto which accepts a number parameter which navigates to a specific index.

With the Bicycle function you can pass startIndex and maxItems — by default Infinity. As Bi-cycle has infinite cycling specifying a maxItems will constrain the value to the range specified — 0 to maxItems.

Keywords

FAQs

Package last updated on 30 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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