constructor(
    defaultDir: ?BidiDirection,
  ) {
    if (!defaultDir) {
      defaultDir = UnicodeBidiDirection.getGlobalDir();
    } else {
      invariant(
        UnicodeBidiDirection.isStrong(defaultDir),
        'Default direction must be a strong direction (LTR or RTL)'
      );
    }
    this._defaultDir = defaultDir;
    this.reset();
  }
Stateful class for paragraph direction detection

@param defaultDir  Default direction of the service