linkfunction
Advanced tools
Comparing version 0.0.12 to 0.0.13
{ | ||
"name": "linkfunction", | ||
"amdName": "linkFunction", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "Link input value into function", | ||
@@ -6,0 +6,0 @@ "main": "dist/linkfunction.js", |
@@ -48,3 +48,22 @@ # linkFunction | ||
Check the javascript vanilla usage: | ||
```js | ||
const linkfunction = require('linkfunction') | ||
const e = { // Will be your SyntheticEvent for input | ||
target: { | ||
nodeName: 'any', | ||
type: 'text', | ||
value: 'Riderman' | ||
} | ||
} | ||
const setName = name => console.log(name) // Output Riderman | ||
const handler = linkfunction(setName) | ||
handler(e) | ||
``` | ||
Here's two equivalent event handlers, one created manually and one created with linkFunction: | ||
@@ -67,3 +86,3 @@ | ||
```js | ||
import linkFunction from '@ridermansb/linkfunction'; | ||
import linkFunction from 'linkfunction'; | ||
@@ -70,0 +89,0 @@ class Foo extends Component { |
10894
158