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

@felte/extender-persist

Package Overview
Dependencies
Maintainers
0
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@felte/extender-persist

Use localStorage to persist your Felte forms

  • 1.0.17
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@felte/extender-persist

Tests Bundle size NPM Version codecov

A package to persist your form's state in localStorage.

Installation

npm install --save @felte/extender-persist

# Or, if you use yarn

yarn add @felte/extender-persist

Usage

Extend Felte with the extender export, the extenders accepts an object with options. A unique ID is required to use it as the ID for the localStorage.

import { extender } from '@felte/extender-persist';

const { form } = createForm({
  // ...
  extend: extender({ id: 'uniqueId' }), // or `extend: [extender({ id: 'uniqueId' })],`
  // ...
});

Ignoring fields

You might not want to save certain fields such as passwords to local storage, for this you may add an extra property to the configuration of the extender with an array of paths to the data you want to ignore:

{
  extend: extender({ id: 'uniqueId', ignore: ['account.password'] }),
}

Or you may add the attribute data-felte-extender-persist-ignore to the input you don't want to persist.

Keywords

FAQs

Package last updated on 29 Oct 2024

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