# Canjs 3.2.1 can-connect get()

**URL:** <https://forums.bitovi.com/t/canjs-3-2-1-can-connect-get/611>\
**Category:** Uncategorized\
**Created:** [April 22, 2017, 10:42pm UTC](https://forums.bitovi.com/t/canjs-3-2-1-can-connect-get/611 "2017-04-22T22:42:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmasilva](https://avatars.discourse-cdn.com/v4/letter/n/a4c791/32.png) [@nmasilva](https://forums.bitovi.com/u/nmasilva)\
**Post date:** [April 22, 2017, 10:42pm UTC](https://forums.bitovi.com/t/canjs-3-2-1-can-connect-get/611/1 "2017-04-22T22:42:10Z")

</div>

Hi,

I’m trying to change the todos MVC example to have a resource that returns an instance instead of a list:

Current code:

```
var AppViewModel = DefineMap.extend("AppViewModel",{
    appName: "string",
    todosList: {
        get: function(lastSet, resolve){
            Todo.getList({}).then(resolve);
        }
    }
});

```

Modified code:

```
var AppViewModel = DefineMap.extend("AppViewModel",{
    appName: "string",
    oneTodo: {
        get: function(resolve){
            Todo.get().then(resolve);
        }
    }
});

fixture("/api/todos", function() {
return { name: "mow lawn", complete: false, id: 5 };
});

proto-compute.js:357 Uncaught RangeError: Maximum call stack size exceeded
    at Compute.get (proto-compute.js:357)
    at Object.compute (can-compute.js:60)
    at AppViewModel.eval (can-define.js:512)
    at AppViewModel.get todos (index.js:58)
    at Compute._get (proto-compute.js:275)
    at Compute.get (proto-compute.js:379)
    at Object.compute (can-compute.js:60)
    at AppViewModel.eval (can-define.js:512)
    at AppViewModel.get todos (index.js:58)
    at Compute._get (proto-compute.js:275)

```

Does anyone knows how to do this ?

Thanks,  
Nuno

---

<div class="post-metadata">

**Author:** ![chasen](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.bitovi.com/chasen/32/402_2.png) [@chasen](https://forums.bitovi.com/u/chasen)\
**Post date:** [April 29, 2017, 3:15am UTC](https://forums.bitovi.com/t/canjs-3-2-1-can-connect-get/611/2 "2017-04-29T03:15:45Z")

</div>

Hi @nmasilva,

In your modified code, your `get` function only takes one argument, which makes it synchronous. When it has two arguments, it’s asynchronous, so you can set the value with whatever the promise returns.

The docs for asynchronous getters are on this page: [https://canjs.com/doc/can-define/map/map.html#Declarativeproperties](https://canjs.com/doc/can-define/map/map.html#Declarativeproperties)
