batmanjs/batman — pull request #1080 by rmosolgo (2014-07-09 23:46:04+00:00)
Title: Syntactic sugar for observable

Every time I write this by hand, I think "I should really upstream this". Well, here goes:

- `toggle` is shorthand for inverting the boolean value of a property
- `increment`/`decrement` are shorthand for `set`ting a property up or down by 1

```coffeescript
game = new Batman.Object
game.increment('score') # => 1
game.decrement('score') # => 0
game.toggle("winning") # => true
game.toggle("winning") # => false
```

Technically, these could live on `Batman.Property`, then `Observable` could use that, but I don't know of any big win there. It's not like `Property` really needs those functions -- they'll always be called on an `Observable`, right?