Git Product home page Git Product logo

controlledloop's Introduction

controlledLoop

A javascript module for moving forward, backward, and in a non-linear fashion through an array or object one or more keys at a time.

Summary

Creating a controlled-loop allows you to move through an array or object in many different ways

  1. iterate similar to generators with next()
  2. backup with previous()
  3. run in bulk like a forEach() but with the ability to stop at any time
  4. chunk or batch a group of items at a time
  5. iterate over every nth item
  6. iterate in reverse
  7. reverse direction mid-flow
  8. skip over items
  9. goto a specific key
  10. Set your own keys array to only use a subset of properties or to set the order
  11. change the callback at any time
### Homepage

http://www.ozonecreations.com/projects/controlled-loop

Installing

GitHub

https://github.com/bartmelton/ControlledLoop

NPM

npm install controlled-loop

Bower

bower install controlled-loop

Exports:

  1. It will export as an AMD module if available, otherwise it will try to export as a CommonJS module
  2. If Lodash or Underscore are available, it adds as a mixin.
  3. If none of the above options are available it falls back to a global controlledLoop() function attached to window, global, or this depending on which is available.

Node

var controlledLoop = require("controlled-loop").controlledLoop

Lodash/Underscore

_.controlledLoop()

Default

controlledLoop();

controlledloop's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.