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

alt-form

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alt-form - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

7

package.json
{
"name": "alt-form",
"version": "4.0.0",
"version": "4.0.1",
"description": "Manage your forms with alt",
"main": "lib/altForm.js",
"dependencies": {
"flux-form": "4.1.0"
"flux-form": "4.1.1"
},

@@ -13,3 +13,4 @@ "devDependencies": {

"scripts": {
"build": "babel src --out-dir lib"
"build": "babel src --out-dir lib",
"prebublish": "npm run build"
},

@@ -16,0 +17,0 @@ "repository": {

@@ -6,3 +6,25 @@ # alt-form

```js
const form = altForm('Company', alt, {
fields: [ 'name' ],
})
class EditName extends React.Component {
constructor(props) {
super(props)
this.state = form.getProps({
name: props.initialName
})
}
// Please don't connect stores yourself, use something like
// https://github.com/altjs/react which connects your stores automatically
componentDidMount() {
this.unlisten = form.store.listen(state => this.setState(state))
}
componentWillUnmount() {
this.unlisten()
}
render() {

@@ -15,6 +37,6 @@ return (

placeholder="Name"
{...this.props.form.props.name}
{...this.state.props.name}
/>
<input type="button" onClick={this.props.form.save} />
<input type="button" onClick={this.state.save} />
</div>

@@ -25,22 +47,6 @@ )

export default connectToStores(EditName, () => {
const form = altForm('Company', alt, {
fields: [ 'name' ],
})
export default EditName
```
return {
listenTo() {
return [form.store]
},
getProps(props) {
return {
form: form.getProps({
name: props.initialName
})
}
},
}
})
```js
<EditName initialName="Jane" />

@@ -47,0 +53,0 @@ ```

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