Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

refract-redux-callbag

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refract-redux-callbag

Component-based architecture and functional programming have become an increasingly popular approach for building UIs. They help make apps more predictable, more testable, and more maintainable.

  • 1.0.0-4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source


Master your React and Redux app's effects through the
power of reactive programming.


Why? · Install · The gist · Learn · Contribute · Discuss


Library size MIT License


Refract lets you isolate your app's side effects - API calls, analytics, logging, etc - so that you can write your code in a clear, pure, and declarative fashion by using reactive programming.

Refract is an extensible library built for React. In addition we provide a Redux integration, which can also serve as a template for integrations with other libraries.

Why?

Component-based architecture and functional programming have become an increasingly popular approach for building UIs. They help make apps more predictable, more testable, and more maintainable.

However, our apps don't exist in a vacuum! They need to make network requests, handle data persistence, log analytics, deal with changing time, and so on. Any non-trivial app has to handle any number of these external effects.

These side-effects hold us back from writing fully declarative code. Wouldn't it be nice to cleanly separate them from our apps?

Refract solves this problem for you. For an in-depth introduction, head to Why Refract.

Installation

npm install --save refract-redux-callbag

Refract is available for a number of reactive programming libraries. For each library, a Refract integration is available for both React and Redux.

Available packages:

ReactRedux
Callbagrefract-callbagrefract-redux-callbag
Mostrefract-mostrefract-redux-most
RxJSrefract-rxjsrefract-redux-rxjs
xstreamrefract-xstreamrefract-redux-xstream

The Gist

import { compose, createStore } from 'redux'
import { refractEnhancer } from 'refract-redux-rxjs'

const reducers = combineReducers({
    username: (state, action) => {
        if (action.type === 'USERNAME') {
            return action.payload
        }

        return state
    }
})
const store = createStore(reducers, {}, compose(refractEnhancer()))

const usernameActions$ = store.observe('USERNAME')
const username$ = store.observe(state => state.username)

Store enhancer

The Refract store enhancer adds an observe method which takes a single argument (action type or store selector) and returns an observable. Read observing redux for more details.

Documentation

Links through to docs sub-pages.

Examples

Contributing

We welcome many forms of contribution from anyone who wishes to get involved.

Before getting started, please read through our contributing guidelines and code of conduct.

The Refract logo is available in the Logo directory.

License

Refract is available under the MIT license.

Discuss

Everyone is welcome to join our discussion channel - #refract on the Reactiflux Discord server.

FAQs

Package last updated on 16 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc