js refactor
add state action to return doors state