Refract
  • Read Me
  • Introduction
    • Why Refract?
    • Core Concepts
    • Thinking In Refract
    • Alternatives
  • Usage
    • Getting Started
    • Installation
    • Connecting To React
    • Observing React, Preact and Inferno
    • Injecting Dependencies
    • Observing Redux
    • Observing Anything
    • Handling Effects
    • Pushing to Props
    • Rendering Components
    • Handling Errors
    • Testing
  • Recipes
    • Dependency Injection
    • Creating An API Dependency
    • Handling state
    • Replacing Redux Connect
  • Examples
    • Debounced fetch
    • Counter
    • Field validation
    • Redux fetch
    • Routing
    • Typeahead
    • Visit time
  • API
    • compose
    • withEffects
    • toProps, asProps
    • useRefract
    • refractEnhancer (Redux)
  • Glossary
  • Feedback
Powered by GitBook
On this page
  • Aperture
  • Handler
  • Error Handler
  1. Usage

Getting Started

PreviousUsageNextInstallation

Last updated 6 years ago

The usage section of the docs explores the intended use of Refract, focusing on each concept or feature in isolation.

If you are unfamiliar with reactive programming, we recommend reading Andre Staltz's article before reading these docs. Reactive programming is central to Refract, so some understanding of the paradigm will be essential.

Before we begin, below is a quick explanation of some new terms associated with Refract which we will use throughout the documentation.

Each will be more thoroughly explored through examples, but starting with a rough approximation in mind will help.

Aperture

An aperture controls the streams of data which enter Refract.

It is a function which observes data sources within your app, passes this data through any necessary logic flows, and outputs a stream of effect values in response.

Handler

A handler is a function which causes side-effects in response to any effect value output by the aperture.

Error Handler

An errorHandler is a function which causes side-effects in response to any error value output by the aperture.

The introduction to Reactive Programming you've been missing