ember-page-title icon indicating copy to clipboard operation
ember-page-title copied to clipboard

Why does `{{page-title}}` return `''`?

Open muziejus opened this issue 2 years ago • 2 comments

I'm just curious why the code returns an empty string instead of nothing at all.

To wit:

  compute(params, _hash) {
    let hash = {
      ..._hash,
      id: this.tokenId,
      title: params.join(''),
    };

    this.tokens.push(hash);
    this.tokens.scheduleTitleUpdate();
    return '';
  }

I tried to find if helpers require a return value from compute, etc., but couldn't find anything.

Given that, from my understanding, the helper is all side effect (adjusting a part of the DOM outside of its own container), it feels like this helper should have no return value at all.

muziejus avatar May 26 '22 00:05 muziejus

Seems like that was done 7 years ago, so maybe at that time it was required? Since side effects are not the primary use case for helpers

knownasilya avatar May 26 '22 00:05 knownasilya

Thanks, @knownasilya.

If there's no requirement for having a return value, I think it'd make sense to get rid of it.

muziejus avatar May 26 '22 03:05 muziejus