Skip to content

Instantly share code, notes, and snippets.

@cowboyd
cowboyd / gemconf.md
Last active May 24, 2016 16:28 — forked from elwayman02/gemconf-2016.md
GEMCONF Recap
{{#with (async (ajax)) as |result|}}
{{#loading-overlay result.isPending}}
<button onclick={{action ajax.get '/products'}}>Load</button>
{{#with (list result) as |products|}}
{{#each (list products) as |item}}
{{item.title}}
<button {{action (action ajax.delete 'products/:id'
data=(hash id=item.id)
on-success=(action products.remove item))
on-error=(action notifications.error 'Could not delete item')
@cowboyd
cowboyd / product-search.hbs
Last active October 30, 2023 17:30 — forked from nelstrom/product-search.hbs
Messing around with Effection. Trying to create a scope, which is torn down with the component. And trying to run a task in that scope in response to user interaction.
<div>
<h1>Product search</h1>
<input {{on 'input' this.doSearch}} value={{this.query}} />
</div>