<commit_before># ember-receive

There are many uses for `ember-receive`, but one of the main uses is to unblock blocked components. Let me show you.

```hbs
<!-- app/components/sidebar/template.hbs -->

{{#some-component data=model as |result|}}
  <!--
    You must use `result` here, or somehow pass it elsewhere
    ember-receive to the rescue!
  -->
  {{pass-to 'outside-area' result}}
{{/some-component}}
```

In another place:
```hbs
<!-- app/application/template.hbs -->

{{#receive-for 'outside-area' as |result send|}}
  <!-- do something with result -->
{{/receive-for}}
```

Check out the demo, `npm start` and `http://localhost:4200`.

## Advanced

```hbs
{{pass-to 'outside-area' (hash test=(component 'some-thing' name=name))}}
```

And consume:

```hbs
{{#receive-for 'outside-area' as |ui send|}}
  <!-- check is necessary or you get unknown helper error -->
  {{#if ui.test}}
    <!-- everything inside will be rendered where the data came from -->
    {{#send.back}}
      {{#ui.test something=data}}
        Block data
        {{different-component}}
      {{/ui.test}}
    {{/send.back}}
  {{/if}}
{{/receive-for}}<commit_msg>Add badge and install<commit_after># ember-receive

It's like a teleporter there and back again!

![Ember Version][ember-version]

```no-highlight
ember install ember-receive
```

There are many uses for `ember-receive`, but one of the main uses is to unblock blocked components. Let me show you.

```hbs
<!-- app/components/sidebar/template.hbs -->

{{#some-component data=model as |result|}}
  <!--
    You must use `result` here, or somehow pass it elsewhere
    ember-receive to the rescue!
  -->
  {{pass-to 'outside-area' result}}
{{/some-component}}
```

In another place:
```hbs
<!-- app/application/template.hbs -->

{{#receive-for 'outside-area' as |result send|}}
  <!-- do something with result -->
{{/receive-for}}
```

Check out the demo, `npm start` and `http://localhost:4200`.

## Advanced

```hbs
{{pass-to 'outside-area' (hash test=(component 'some-thing' name=name))}}
```

And consume:

```hbs
{{#receive-for 'outside-area' as |ui send|}}
  <!-- check is necessary or you get unknown helper error -->
  {{#if ui.test}}
    <!-- everything inside will be rendered where the data came from -->
    {{#send.back}}
      {{#ui.test something=data}}
        Block data
        {{different-component}}
      {{/ui.test}}
    {{/send.back}}
  {{/if}}
{{/receive-for}}


[ember-version]: https://embadge.io/v1/badge.svg?start=2.3.0
{'fraction_non_alphanumeric': 0.18521494576134995, 'fraction_numerical': 0.004821213338690237, 'mean_word_length': 3.337979094076655, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2029037', 'n_tokens_mistral': 850, 'n_tokens_neox': 796, 'n_words': 252}