Where there is an express or implied contract that the agency should be continued for any period of time, the principal must make compensation to the agent, or the agent to the principal, as the case may be, for any previous revocation or renunciation of the agency without sufficient cause.