State handler for javascript objects.