Closed wchaering closed 7 years ago
Thanks for the PR @wchaering
But it's not a typo, it's something that's not well documented. The set method for objects accepts both inputs, and they are equivalent:
var updated = state.set( 'e', 4 ); var updated = state.set({'e': 4});
The first one is really useful for setting as key the value of another variable, for example:
var key = fullfillCondition ? 'foo' : 'bar'; state.set( key, 1 );
I'll add the second set form to the documentation for the next release.
Thanks for the PR @wchaering
But it's not a typo, it's something that's not well documented. The set method for objects accepts both inputs, and they are equivalent:
The first one is really useful for setting as key the value of another variable, for example: