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

create-observable-thunk

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-observable-thunk

Provides a H.O.F. that wraps any function returning an [Rx.Observable](http://github.com/ReactiveX/RxJS) in a [thunk](http://github.com/gaearon/redux-thunk)

  • 0.3.5
  • latest
  • Source
  • npm
  • Socket score

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

Provides a H.O.F. that wraps any function returning an Rx.Observable in a thunk

Install

This has peer dependencies of rxjs@5.x.x, redux, and redux-thunk, which will have to be installed as well.

npm install --save create-observable-thunk

or

yarn add create-observable-thunk

Example

users-thunks.js

import { createObservableThunk } from "create-observable-thunk"
import { loadUser } "./users-api"
import { loadUsersRequest, loadUsersSuccess, loadUsersFailure } from "./users-actions"

export const loadUsers = createObservableThunk({
  method: api.loadUsers,
  before: loadUsersRequest,
  success: loadUsersSuccess,
  failure: loadUsersFailure,
})

components/UserContainer.jsx

import { connect } from "react-redux"
import { loadUsers } from "../users-thunks"
import { Users } from "./Users"

export const UsersContainer = connect(null, { loadUsers })(Users)

Keywords

FAQs

Package last updated on 13 Jul 2017

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