<DataLoader
  @items={{item}}
  @src={{uri
    '/${nspace}/${dc}/${type}/${src}'
    (hash
      nspace=nspace
      dc=dc
      type=type
      src=src
    )
  }}
  @onchange={{action "setData"}}
  @once={{true}}
>
  <BlockSlot @name="loaded">

    <DataWriter
      @sink={{uri
        '/${nspace}/${dc}/${type}'
        (hash
          nspace=nspace
          dc=(or data.Datacenter dc)
          type=type
        )
      }}
      @type={{type}}
      @label={{label}}
      @ondelete={{action ondelete}}
      @onchange={{action onsubmit}}
      as |writer|>

{{#let (hash
  data=data
  change=(action "change")
  isCreate=create
  error=writer.error
  disabled=writer.inflight
  submit=(action writer.persist data)
  delete=(action writer.delete data)
) as |api|}}

      {{yield api}}
    {{#if hasError}}
      <BlockSlot @name="error">
        <YieldSlot @name="error">
          {{yield api}}
        </YieldSlot>
      </BlockSlot>
    {{/if}}

      <BlockSlot @name="content">
        <YieldSlot @name="form">
          {{yield api}}
        </YieldSlot>
      </BlockSlot>

{{/let}}

    </DataWriter>

  </BlockSlot>
</DataLoader>