# refractEnhancer (Redux)

Used to enhance a Redux store, adding observable functionality which can be used inside Refract.

## Packages

`refractEnhancer` is provided by our Redux packages - `refract-redux-callbag`, `refract-redux-most`, `refract-redux-rxjs`, and `refract-redux-xstream`.

## Signature

```javascript
refractEnhancer = (options?) => {
    return StoreCreator
}
```

## Arguments

1. `options` *(object)*: an object which configures the Refract store enhancer.

   Two options are currently available for the `refractEnhancer`:

   * `eventsPrefix` *(string)*: defines an actionType prefix which marks actions which are *not* intended to be forwarded to your reducers. Refract will intercept these, preventing them from touching your state (or any downstream store enhancers), but will forward them on to any watching apertures. (default: `@@event/`)
   * `methodName` *(string)*: customises the name used for the `store.observe` method. (default: `observe`)

     Note that customising the `methodName` option with TypeScript will break the Redux `Store` interface, which is extended when you import the Refract enhancer. To use this option with TypeScript, you will need to extend the interface - for example:

     ```javascript
     import { StoreObserveFunction } from 'refract-redux-rxjs'

     declare module 'redux' {
         interface Store {
             observeWithRxjs: StoreObserveFunction
         }
     }
     ```

## Returns

`StoreCreator` *(Redux store creator)*: a function which creates a redux store. Note that you should not be calling this function directly, and instead should be passing it into Redux `createStore`.

## Example

```javascript
import { createStore } from 'redux'
import { refractEnhancer } from 'refract-redux-rxjs'
import rootReducer from './reducers'
​
export default function configureStore() {
    const store = createStore(rootReducer, null, refractEnhancer())
    ​
    return store
}
```

[Read more about configuring your Redux store here!](https://redux.js.org/recipes/configuring-your-store)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://refract.js.org/api/refractenhancer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
