Socket
Socket
Sign inDemoInstall

drfrf

Package Overview
Dependencies
26
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    drfrf

Django REST framework - redux-form connector


Version published
Weekly downloads
6
decreased by-33.33%
Maintainers
1
Install size
196 kB
Created
Weekly downloads
 

Readme

Source

drfrf

CircleCI npm

Django REST framework - redux-form connector

Installation

$ yarn add drfrf

Usage

Compose the drfrf higher-order component with reduxForm:

import drfrf from "drfrf"
import { connect } from "react-redux"
import { compose } from "recompose"

const App = props => <form>...</form>

export default compose(
  drfrf({
    endpoint: "http://example.com/api/items/validate/",
  }),
  reduxForm({ ... })
)(App)

To-daa! Your form automatically queries the specified endpoint with every onChange and displays errors from the backend! 🎉

Browse the complete example here: https://github.com/Theodo-UK/drfrf/tree/master/example/frontend/src

API

drfrf exposes a single HOC which sets the asyncValidate prop for redux-form to use. This HOC accepts a configuration object with the following properties:

namedefaultdescription
endpointnoneURL to call with every change
method"POST"HTTP method to use

Backend integration

If you're using Django in your backend, check out drfrf for the backend.

Keywords

FAQs

Last updated on 18 Jan 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc