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

final-form-persist

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-form-persist

Persist your form values into a storage

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
629
increased by32.42%
Maintainers
2
Weekly downloads
 
Created
Source

final-form-persist

Persist your final-form values into a storage

NPM JavaScript Style Guide

Install

npm install --save final-form-persist

or

yarn add final-form-persist

Usage

import { createForm } from 'final-form'
import { createPersistDecorator } from 'final-form-persist'

const form = createForm({ onSubmit })

const { persistDecorator, clear } = createPersistDecorator({
  name: 'myPersistKey'
  debounceTime: 500 // in ms
  whitelist: ['some', 'key']
  storage: localStorage // this is the default
})

const undecorate = persistDecorator(form)

// Use form

// Remove the entry from the storage if you want
clear()

// Clean up
undecorate()

Example

Example build with react-final-form

API

createPersistDecorator

Creates a final form decorator.

createPersistDecorator = ({
  name: string
  debounceTime?: number
  whitelist: string[]
  storage?: Storage
}) => FinalFormPersistDecorator

type FinalFormPersistDecorator

{
  persistDecorator: Decorator
  clear: () => void
  isPersisted: boolean
}

License

MIT © premieroctet

FAQs

Package last updated on 19 Nov 2019

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