factorial-form
Advanced tools
Comparing version 0.0.1 to 0.0.2
# Changelog | ||
## `0.0.2` | ||
Fixed dependencies | ||
## `0.0.1` | ||
First version |
{ | ||
"name": "factorial-form", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Factorial form library", | ||
@@ -40,4 +40,7 @@ "repository": { | ||
"babel-jest": "^20.0.3", | ||
"babel-plugin-transform-async-to-generator": "^6.24.1", | ||
"babel-plugin-transform-decorators-legacy": "^1.3.4", | ||
"babel-plugin-transform-flow-strip-types": "^6.22.0", | ||
"babel-plugin-transform-runtime": "^6.23.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
@@ -44,0 +47,0 @@ "babel-preset-stage-1": "^6.24.1", |
@@ -18,2 +18,31 @@ # Factorial form | ||
```js | ||
import { Form } from 'factorial-form' | ||
const attributes = { | ||
name: 'paco', | ||
salary: 18000, | ||
created_at: 1497521766937, | ||
metadata: { | ||
friends: 12 | ||
} | ||
} | ||
const schema = { | ||
name: 'string', | ||
salary: 'cents', | ||
age: 'timestamp', | ||
metadata: { | ||
friends: 'number' | ||
} | ||
} | ||
const form = new Form(attributes, schema) | ||
const field = form.get('name') | ||
field.value // => 'paco' | ||
form.isDirty // => false | ||
field.set('pepe') | ||
field.value // => 'pepe' | ||
field.isDirty // => true | ||
form.isDirty // => true | ||
``` | ||
@@ -20,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
566031
52
26