# resources (as a function)

> FullCalendar v3 documentation, for an old release. Web version: https://legacy.fullcalendar.io/v3/resources-function
>
> Latest version (v7): https://fullcalendar.io/docs/resources-function.md

Premium feature.

Tells the calendar to fetch the resources list by executing a function.<!--more--> The function is given a `callback` argument that should be called with an array of [Resource Objects](https://legacy.fullcalendar.io/v3/resource-object.md):

```js
$('#calendar').fullCalendar({

  resources: function(callback) {
    somethingAsynchonous(function(resourceObjects) {
      callback(resourceObjects);
    });
  }

});
```

This allows for any sort of asynchronous means of obtaining the resource list.

If [refetchResourcesOnNavigate](https://legacy.fullcalendar.io/v3/refetchResourcesOnNavigate.md) is set to `true`, the resources function will receive additional arguments. It will receive the start and end moments for the newly visible window of time as well as the calendar's timezone:

```js
$('#calendar').fullCalendar({

  refetchResourcesOnNavigate: true,

  resources: function(callback, start, end, timezone) {
    somethingAsynchonous(start, end, timezone, function(resourceObjects) {
      callback(resourceObjects);
    });
  }

});
```

These arguments are similar to what the [events function](https://legacy.fullcalendar.io/v3/events-function.md) receives, though in a different order.

This `refetchResourcesOnNavigate` behavior is present in v1.5.1 and later.
