function setState (entity) {
    return function (nextState) {
      updateEntityState(entity, nextState)
    }
  }
Whenever setState or setProps is called, we mark the entity
as dirty in the renderer. This lets us optimize the re-rendering
and skip components that definitely haven't changed.

@param {Entity} entity

@return {Function} A curried function for updating the state of an entity