updated docs for state() to describe use with closures