tracked-tools / ember-could-get-used-to-this

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Document how to provide named arguments

abeforgit opened this issue · comments

In the README it is mentioned that one can provide named arguments to a resource, however, it doesn't say how.
I've tried returning an object instead of an array from the initializer function, like so:

class MyResource extends Resource{
  setup() {
    console.log(this.args.named); //empty
    }
}

class MyComponent extends Component {
   @use data = new MyResource(() => ({foo: this.args.foo, bar: this.args.bar}));
   
  }

But no dice. How can we do this? and if we can't, it would be good to add to the README