propup

0.1.0 • Public • Published

propup

Increment or decrement values nested in an object

example

var propup = require('propup')

var player = {
  position: {
    x: 0,
    y: 0,
    z: 0,
  },
  soemthing: 99,
}

var interval = setInterval(function() {
  
  // Every second, increase player.position.y by 2 until it reaches 100
  var done = propup({position:{y:100}}, player, 2)

  // Returns boolean whether all values have reached their destinations
  if (done) clearInterval(interval)

}, 1000)

install

With npm do:

npm install propup

Use browserify to require('propup').

release history

  • 0.1.0 - initial release

license

Copyright (c) 2013 Kyle Robinson Young
Licensed under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i propup

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • shama