GitShow/developit/linkstate
developit

linkstate

Bind events to state. Works with Preact and React.

by developit
event-handlershandlerlinkstatepreact
Star on GitHubForknpm

JavaScript

293 stars23 forks8 contributorsQuiet · 5y agoSince 20172.0.0MIT

Meet the team

See all 8 on GitHub →
developit
developit24 contributions
pl12133
pl121332 contributions
sapegin
sapegin1 contribution
Firaenix
Firaenix1 contribution
whitetrefoil
whitetrefoil1 contribution
nickytonline
nickytonline1 contribution
ofirgeller
ofirgeller1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Quiet · 4 in progress · Last activity 5y ago
See all on GitHub →
connorjclark
Using with "range" input sets the state as a string, instead of a numberOpenIssue

Relevant line to change: https://github.com/developit/linkstate/blob/master/src/index.js#L19 Would be nice if this used "valueAsNumber" if the input type is or .

connorjclark · 5y ago
rschristian
fix: Correcting polyfill's entry in the root package exportsOpenPR

I made this back when the export was fixed but forgot to make the PR.

rschristian · 5y ago
cmlenz
Added typings for hook.OpenPR
cmlenz · 5y ago

Recent fixes

View closed PRs →
divyenduz
Is it possible to link multiple states?ClosedIssue

Is it possible to link a change event to multiple objects in state? In my use case, there are three state objects that have 3 inputs in my app but a special case requires me to keep them in sync against one input object. P.S. Thanks for building this.

divyenduz · 2y ago
dotcypress
Add callback argumentMergedPR

Add callback argument to build some cool stuff around 👌 We use our bike-shed for form validation, but our implementation of is so naive and we really want to use this great module as dependency. 👍

dotcypress · 5y ago
gamebox
Passing Scalar value throws ClosedIssue

On the Linked State section of the website, you say: For custom event handlers, passing scalar values to the handler generated by linkState() will simply use the scalar value. Most of the time, this behavior is desirable. But when I write something like this: for an onInput handler, I get the following error: linkstate.es.js:21 Uncaught TypeError: Cannot read property 'nodeName' of undefined at eval (linkstate.es.js:21) at Object.onInput [as input] (home.js:139) at HTMLInputElement.eventProxy (preact.js:96) It looks like the offending code is the first line of the returned handler: This will cause (the passed in value) to pass on the next value which is undefined as is , so will end up being undefined. Wouldn't the correct way to write this code for the intended behavior be the following? 'var t = (e && e.target) this,` This is my first issue on this project, but I am currently writing a POC for my company(a Series A funded startup) and am optimistic that we will be moving our Customer-facing apps to Preact from Angular 1.x over the course of the coming year and would like to contribute back to the framework. Let me know if my suggestion is on the right track, and I'll dash off a PR.

gamebox · 5y ago
Structured data for AI agents

Repository: developit/linkstate. Description: Bind events to state. Works with Preact and React. Stars: 293, Forks: 23. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Topics: event-handlers, handler, linkstate, preact. Latest release: 2.0.0 (5y ago). Open PRs: 4, open issues: 1. Last activity: 5y ago. Community health: 42%. Top contributors: developit, pl12133, sapegin, Firaenix, whitetrefoil, nickytonline, ofirgeller.

·@ofershap

Replace github.com with gitshow.dev