Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does {{page-title}} return ''? #236

Open
muziejus opened this issue May 26, 2022 · 2 comments
Open

Why does {{page-title}} return ''? #236

muziejus opened this issue May 26, 2022 · 2 comments

Comments

@muziejus
Copy link

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.

@knownasilya
Copy link
Contributor

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

@muziejus
Copy link
Author

Thanks, @knownasilya.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants