# Function: adapt()

> **adapt**\<`State`, `S`, `R`, `R2`, `ReturnedSources`\>(`initialState`, `second`): `ReactStore`\<`State`, `S`, `object` *extends* `R` ? `R2` : `R`\>

See [StateAdapt.adapt](../../../state-adapt-rxjs/references/index/StateAdapt.md#adapt) for the complete API.

This wrapper additionally lets you call the store as a function for its
current state, or call a selector property for its current result.

```ts
import { stringAdapter } from '@state-adapt/core/adapters';
import { adapt } from '@state-adapt/react';

const name = adapt('John', stringAdapter);

console.log(name()); // 'John'
console.log(name.uppercase()); // 'JOHN'
```

See [derive](./derive.md) for composing these reads.
