0.1.0 • Published 11 years ago

propup v0.1.0

Weekly downloads
1
License
-
Repository
github
Last release
11 years ago

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.