code: function distinctUntilKeyChanged(keySelector) {
      return function* (it) {
          let prev = undefined;
          for (const item of it) {
              const key = keySelector(item);
              if (key === prev) {
                  continue;
              }
              prev = key;
              yield item;
          }
      };
  }
docs: Play items from a set, skipping ones that do not change