[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [Resource](https://evolu.dev/docs/api-reference/common/Resource) › createResettableResource

```ts
function createResettableResource<T extends Resource, D>(
  create: Task<T, never, D>,
): Task<ResettableResource<T>, never, D>;
```

Defined in: [packages/common/src/Resource.ts:646](https://github.com/evoluhq/evolu/blob/bc4578a260dd15d5bbf94b83765ca05984d194cb/packages/common/src/Resource.ts#L646)

Creates [ResettableResource](https://evolu.dev/docs/api-reference/common/Resource/interfaces/ResettableResource).

The first resource is created before this Task returns; if that creation
aborts, nothing is left running. If the caller's Fiber aborts during initial
creation, this Task waits for creation to settle, disposes any created
resource, and returns the abort instead of a resource.

The `create` Task must not fail: the previous resource is already disposed
when it runs, so a failure would leave nothing to fall back to. Handle
recoverable failures inside `create`, or return a resource whose state models
them.

The resource's own API must model its not-ready state, as a reconnecting
connection models "connecting": `get` returns `undefined` during a reset, and
callers treat that absence the same way. A resource whose API assumes
readiness gains nothing here; every caller would rebuild that state around
it.

As with [createSharedResource](https://evolu.dev/docs/api-reference/common/Resource/functions/createSharedResource), a returned resource must be live and
independently owned, and `create` runs on a Run created from the Run that
executes this Task, so dependencies are captured at creation time.

Every successful `create` invocation must return a fresh object identity,
never one returned earlier. A reset skips when the observed resource is no
longer current, and that comparison is by identity; a reused object makes a
stale observation match the replacement and reset it again.

A reset runs `create` and the resource's disposer while holding a
non-reentrant lock. Neither may directly or transitively await another
[reset](https://evolu.dev/docs/api-reference/common/Resource/interfaces/ResettableResource#reset) of this ResettableResource, because
that reset waits for the same lock.