<commit_before><box xs="10" class="offset-xs-1" vertical>
  <box fit>
    <hbox fit>
      <h1>Sustain</h1>
      <hbox align="center" justify="end">
        <span>Next {{#link-to 'docs.layout-attributes'}} Attribute Syntax{{/link-to}}</span>
      </hbox>
    </hbox>
    <p>
      Use the sustain helper to explicitly declare component instances that can be recycled.
      This lets Ember recycle a component instance and it's associated DOM across layout and
      route boundaries.
    </p>

    {{code-snippet name='sustain-1.hbs'}}

    <p>
      A sustain is essentially a "marker" for where a particular component instance should be inserted.
    </p>
    <p>
      Since the component a sustain specifies is moved from marker to marker, only one marker instance
      for a given component name can be used at a time (Coming Soon: 1.1 will allow multiple named instances).
    </p>
    <p>
      This produces a significant performance advantage by allowing you to seamlessly restructure your
      app's DOM when shifting from one layout or route to another without needing to teardown and rebuild DOM.
    </p>

    <h3>Providing a model for your component</h3>

    {{code-snippet name='sustain-2.hbs'}}

    <h4>Complex Models</h4>
    <p>
      Use the hash helper to handle more complex model situations.
    </p>
    {{code-snippet name='sustain-3.hbs'}}

    <h3>Dealing with animation and other scenarios in which two instances exist at once.</h3>
    <p>
      Only one instance of the sustainable is alive and rendered at a time, but if you are animating
      from one location to another you can choose to leave behind a copy.
    </p>
    {{code-snippet name='sustain-4.hbs'}}

    <h3>Configuring the component's cache expire time.</h3>
    <p>
      By default, a sustain is destroyed when it has gone unused for 15 seconds.
      You can alter this expiration. A value of 0 or -1 will cause the sustain to
      live forever.
    </p>
    {{code-snippet name='sustain-5.hbs'}}
  </box>
</box>

{{!--

{{!-- BEGIN-SNIPPET sustain-1
{{sustain 'foo-component'}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-2
{{sustain 'foo-component' model}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-3
{{sustain 'foo-component' (hash emails=model.emails foo=(action 'foo') bar=bar)}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-4
{{sustain 'foo-component' copy=true)}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-5
{{sustain 'foo-component' expires=0}}
{{-- END-SNIPPET

--}}<commit_msg>feat(labels): adds documentation for label<commit_after><box xs="10" class="offset-xs-1" vertical>
  <box fit>
    <hbox fit>
      <h1>Sustain</h1>
      <hbox align="center" justify="end">
        <span>Next {{#link-to 'docs.layout-attributes'}} Attribute Syntax{{/link-to}}</span>
      </hbox>
    </hbox>
    <p>
      Use the sustain helper to explicitly declare component instances that can be recycled.
      This lets Ember recycle a component instance and it's associated DOM across layout and
      route boundaries.
    </p>

    {{code-snippet name='sustain-1.hbs'}}

    <p>
      A sustain is essentially a "marker" for where a particular component instance should be inserted.
    </p>
    <p>
      Since the component a sustain specifies is moved from marker to marker, only one marker instance
      for a given component name can be used at a time, unless a unique label is provided.
    </p>
    <p>
      This produces a significant performance advantage by allowing you to seamlessly restructure your
      app's DOM when shifting from one layout or route to another without needing to teardown and rebuild DOM.
    </p>

    <h3>Providing a model for your component</h3>

    {{code-snippet name='sustain-2.hbs'}}

    <h4>Complex Models</h4>
    <p>
      Use the hash helper to handle more complex model situations.
    </p>
    {{code-snippet name='sustain-3.hbs'}}

    <h3>Dealing with animation and other scenarios in which two instances exist at once.</h3>
    <p>
      Only one instance of the sustainable is alive and rendered at a time, but if you are animating
      from one location to another you can choose to leave behind a copy.
    </p>
    {{code-snippet name='sustain-4.hbs'}}

    <h3>Configuring the component's cache expire time.</h3>
    <p>
      By default, a sustain is destroyed when it has gone unused for 15 seconds.
      You can alter this expiration. A value of 0 or -1 will cause the sustain to
      live forever.
    </p>
    {{code-snippet name='sustain-5.hbs'}}

    <h3>Labeling a sustain</h3>
    <p>
      If you need more than one instance of a component to be recycleable, you may provide a unique label
      for the sustain.  The instance will only be reused in locations where that label appears in conjunction
      with the same Component Name.
    </p>
    {{code-snippet name='sustain-6.hbs'}}

  </box>
</box>

{{!--

{{!-- BEGIN-SNIPPET sustain-1
{{sustain 'foo-component'}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-2
{{sustain 'foo-component' model}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-3
{{sustain 'foo-component' (hash emails=model.emails foo=(action 'foo') bar=bar)}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-4
{{sustain 'foo-component' copy=true)}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-5
{{sustain 'foo-component' expires=0}}
{{-- END-SNIPPET

{{!-- BEGIN-SNIPPET sustain-6
{{sustain 'foo-component' model label="a-key"}}
{{-- END-SNIPPET

--}}
{'fraction_non_alphanumeric': 0.12197802197802197, 'fraction_numerical': 0.011355311355311355, 'mean_word_length': 3.0066030814380045, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 75, 'https://': 0, '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': '4325794', 'n_tokens_mistral': 1742, 'n_tokens_neox': 1668, 'n_words': 633}