# @paypossible/formik-store

> Persist and populate Formik form using storage of your choice

Latest version **1.0.1** (published 2023-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @paypossible/formik-store
pnpm add @paypossible/formik-store
yarn add @paypossible/formik-store
bun add @paypossible/formik-store
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-12-17 |
| First published | 2023-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tiaan du Plessis |
| Maintainers | paypossible-admin |
| Keywords | formik, persist, storage, store, localstorage, sessionstorage |

## Links

- npm: https://www.npmjs.com/package/@paypossible/formik-store
- Repository: https://github.com/tiaanduplessis/formik-store
- Homepage: https://github.com/tiaanduplessis/formik-store#readme
- Issues: https://github.com/tiaanduplessis/formik-store/issues
- npm.io page: https://npm.io/package/@paypossible/formik-store

## Dependencies (3)

- [object.omit](https://npm.io/package/object.omit.md) ^3.0.0
- [debounce-promise](https://npm.io/package/debounce-promise.md) ^3.1.2
- [react-fast-compare](https://npm.io/package/react-fast-compare.md) ^2.0.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2023-12-17

## README

# formik-store
[![package version](https://img.shields.io/npm/v/formik-store.svg?style=flat-square)](https://npmjs.org/package/formik-store)
[![package downloads](https://img.shields.io/npm/dm/formik-store.svg?style=flat-square)](https://npmjs.org/package/formik-store)
[![standard-readme compliant](https://img.shields.io/badge/readme%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
[![package license](https://img.shields.io/npm/l/formik-store.svg?style=flat-square)](https://npmjs.org/package/formik-store)
[![make a pull request](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![Greenkeeper badge](https://badges.greenkeeper.io/tiaanduplessis/formik-store.svg)](https://greenkeeper.io/)

> Persist and populate Formik form using storage of your choice

## Table of Contents

- [About](#about)
- [Usage](#usage)
- [Install](#install)
- [Contribute](#contribute)
- [License](#License)

## About

This package is mostly based on [formik-persist](https://github.com/jaredpalmer/formik-persist), but adds some additional features I required such as:

- Setting a custom storage method as long as it is localstorage/sessionstorage API complaint.
- Ignoring certain values from storage.
- Support for Async storage method e.g. `storage.getItem('foo').then(...)`

If you don't need any of these things, use [formik-persist](https://github.com/jaredpalmer/formik-persist) instead.

## Usage

```js
import React from 'react'
import { Formik, Field, Form } from 'formik'
import FormikStore from 'formik-store'

export const Signup = () =>
  <div>
    <h1>My Uncool Persisted Form</h1>
    <Formik
      onSubmit={values => console.log(values)}
      initialValues={{ firstName: '', lastName: '', email: '' }}
      render={props =>
        <Form className="whatever">
          <Field name="firstName" placeholder="First Name" />
          <Field name="lastName" placeholder="Last Name" />
          <Field name="email" type="email" placeholder="Email Address" />
          <button type="submit">Submit</button>
          <FormikStore name="signup" storage={window.sessionStorage} ignore={['email']} />
        </Form>}
    />
  </div>;
```


## Install

This project uses [node](https://nodejs.org) and [npm](https://www.npmjs.com). 

```sh
$ npm install formik-store
$ # OR
$ yarn add formik-store
```

## Contribute

1. Fork it and create your feature branch: `git checkout -b my-new-feature`
2. Commit your changes: `git commit -am "Add some feature"`
3. Push to the branch: `git push origin my-new-feature`
4. Submit a pull request

## License

MIT © Tiaan du Plessis

---
_Source: https://npm.io/package/@paypossible/formik-store · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
