Socket
Socket
Sign inDemoInstall

linkfunction

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.11 to 0.0.12

2

package.json
{
"name": "linkfunction",
"amdName": "linkFunction",
"version": "0.0.11",
"version": "0.0.12",
"description": "Link input value into function",

@@ -6,0 +6,0 @@ "main": "dist/linkfunction.js",

@@ -1,6 +0,6 @@

# linkedValue
# linkFunction
> Create an Event handler function that call a given function with input value.
- **Tiny:** ~**230 bytes** of [ES3](https://unpkg.com/linkedvalye) gzipped
- **Tiny:** ~**230 bytes** of [ES3](https://unpkg.com/linkfunction) gzipped
- **Familiar:** it's just a function that does what you would have done manually

@@ -26,12 +26,12 @@ - **Standalone:** one function, no dependencies, works everywhere

```sh
npm install --save linkedvalue
npm install --save linkfunction
```
The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com/linkedvalue/dist/linkedvalue.umd.js):
The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](https://unpkg.com/linkfunction/dist/linkfunction.umd.js):
```html
<script src="//unpkg.com/linkedvalue/dist/linkedvalue.umd.js"></script>
<script src="//unpkg.com/linkfunction/dist/linkfunction.umd.js"></script>
```
This exposes the `linkedValue()` function as a global.
This exposes the `linkFunction()` function as a global.

@@ -42,5 +42,5 @@ * * *

It's important to understand what linkedValue does in order to use it comfortably.
It's important to understand what linkFunction does in order to use it comfortably.
**`linkedValue(fn, [valuePath])`**
**`linkFunction(fn, [valuePath])`**

@@ -51,3 +51,3 @@ - `fn`: the function that will called with value as parameter

Here's two equivalent event handlers, one created manually and one created with linkedValue:
Here's two equivalent event handlers, one created manually and one created with linkFunction:

@@ -59,6 +59,6 @@ ```js

handleInput = linkedValue(myFn)
handleInput = linkFunction(myFn)
```
Notice how we didn't specify the event path - if omitted, `linkedValue()` will use the `checked` or `value` property of the event target, based on its type.
Notice how we didn't specify the event path - if omitted, `linkFunction()` will use the `checked` or `value` property of the event target, based on its type.

@@ -70,3 +70,3 @@ ## Usage

```js
import linkedValue from '@ridermansb/linkvalue';
import linkFunction from '@ridermansb/linkfunction';

@@ -82,3 +82,3 @@ class Foo extends Component {

value={obj.name}
onInput={linkValue(this.setName)}
onInput={linkFunction(this.setName)}
/>

@@ -120,4 +120,4 @@ );

- Fork it!
- Clone your fork: `git clone https://github.com/<your-username>/linkvalue`
- Navigate to the newly cloned directory: `cd linkvalue`
- Clone your fork: `git clone https://github.com/<your-username>/linkfunction`
- Navigate to the newly cloned directory: `cd linkfunction`
- Create a new branch for the new feature: `git checkout -b my-new-feature`

@@ -136,3 +136,3 @@ - Install the tools necessary for development: `npm install`

The main reason to created another one was the dependencies. linkValue has no dependency of framework or lib, just function that call another function.
The main reason to created another one was the dependencies. linkFunction has no dependency of framework or lib, just function that call another function.

@@ -139,0 +139,0 @@ However, I would like to thanks [Jason Miller](https://jasonformat.com/) for the incredible project

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc