> For the complete documentation index, see [llms.txt](https://ferp.mrbarry.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ferp.mrbarry.com/understanding-effects-in-ferp/what-is-a-ferp-effect.md).

# What is a Ferp Effect?

## Effects

A side-effect, or simply effect, is a way of talking the world outside of your Ferp application. Effects will always be a composition of the [Core Effects](/understanding-effects-in-ferp/core-effects.md).

You effects may look something like:

{% code title="effectExamples.js" %}

```javascript
import { effects } from 'ferp';

const MyAction = (state) => [state, effects.none()];

const exampleEffects = {
  effect1: effects.thunk(() => effects.none()),
  effect2: effects.defer(1234),
  effect3: effects.act(MyAction),
};
```

{% endcode %}

Ultimately, you will want to compose your effects to be consistent, meaningful, and easy to use.

### The Inside World

When we talk about your application, there are essentially two contexts, or worlds. The first is the inside world. This is anything that lives inside of your application state. To be even more strict, it's anything in your application state that can also be serialized. This doesn't mean that your state has to be capable of being serialized to JSON or similar, but that pieces that are serializable are the inside world parts of your application. Things in the inside world are easily used, manipulated, and tested through actions.

### The Outside World

&#x20;There are some things that are obviously the outside world, and some that are less obvious; we should probably discuss what belongs in an effect.

Some obvious examples of the outside world are external servers and processes. To talk to them, maybe you use fetch, a file, or an IPC channel. There is a very clear boundary between your Ferp application and another application or server. Some less obvious examples are local files, accessing the system clock, generating a random number. More strictly, even modules you import in your files are in some sense a side-effect.

## Talk to the Outside World in Isolation

While in some sense, the outside world is a scary place, filled with uncertainty and chaos, using Ferp's [Core Effects](/understanding-effects-in-ferp/core-effects.md) forces these communication channels to be isolated from harming our precious application.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://ferp.mrbarry.com/understanding-effects-in-ferp/what-is-a-ferp-effect.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
