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

final-form-calculate

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

final-form-calculate - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

21

package.json
{
"name": "final-form-calculate",
"version": "1.1.0",
"description":
"Decorator for calculating field values based on other field values in 🏁 Final Form",
"version": "1.2.0",
"description": "Decorator for calculating field values based on other field values in 🏁 Final Form",
"main": "dist/final-form-calculate.cjs.js",
"jsnext:main": "dist/final-form-calculate.es.js",
"module": "dist/final-form-calculate.es.js",
"files": ["dist"],
"files": [
"dist"
],
"typings": "dist/index.d.ts",
"scripts": {

@@ -15,4 +17,3 @@ "start": "nps",

},
"author":
"Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)",
"author": "Erik Rasmussen <rasmussenerik@gmail.com> (http://github.com/erikras)",
"license": "MIT",

@@ -60,3 +61,4 @@ "repository": {

"rollup-plugin-replace": "^2.0.0",
"rollup-plugin-uglify": "^3.0.0"
"rollup-plugin-uglify": "^3.0.0",
"typescript": "^2.7.2"
},

@@ -67,3 +69,6 @@ "peerDependencies": {

"lint-staged": {
"*.{js,json,md,css}": ["prettier --write", "git add"]
"*.{js,json,md,css}": [
"prettier --write",
"git add"
]
},

@@ -70,0 +75,0 @@ "bundlesize": [

@@ -55,2 +55,12 @@ # 🏁 Final Form Calculate

{
field: 'foo', // when the value of foo changes...
updates: {
// ...asynchronously set field "doubleFoo" to twice the value using a promise
doubleFoo: (fooValue, allValues) =>
new Promise(resolve => {
setTimeout(() => resolve(fooValue * 2), 100)
})
}
},
{
field: /\.timeFrom/, // when a deeper field matching this pattern changes...

@@ -127,8 +137,8 @@ updates: (value, name, allValues) => {

### `UpdatesByName: { [FieldName]: (value: any, allValues: Object) => any }`
### `UpdatesByName: { [FieldName]: (value: any, allValues: Object) => Promise | any }`
Updater functions for each calculated field.
### `UpdatesForAll: (value: any, field: string, allValues: Object) => { [FieldName]: any }`
### `UpdatesForAll: (value: any, field: string, allValues: Object) => Promise | { [FieldName]: any }`
Takes the value and name of the field that just changed, as well as all the values, and returns an object of fields and new values.
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