AmpersandJS/ampersand-state — pull request #114 by nathanstitt (2014-12-03 23:20:08+00:00)
Title: idempotent computed default properties

When a default value or function is provided for a property, state should only
consult the default once. It should then set the value from the default and
return that value on subsequent calls.

Corrects issues #60, but may need more refinement. This does not call `set` to
store the value, rather it simply stores it by directly manipulating the _values
object.

I'm conflicted if it should call `set` to store the value or not. If it did so, then there's
a possibility that it would throw an exception if it sets a non-valid value.

Doing so would would also fire a "change" event that might be unwanted.

It might also be called before the object is completely initialized and is missing the _change
object. In that case an outright error is encountered. I believe thats the cause of the
exceptions that @francismakes noted in the comments for #60. That can be worked around,
but is a bit more involved that we'd perhaps want it to be.

At any rate, I consider this a starting point to resolving the issue and am happy to rework in response
to comments.