segmentio / validate-form

Easily validate a form element against a set of rules.
43 stars 6 forks source link

Support non-elements more thoroughly #7

Open dominicbarnes opened 10 years ago

dominicbarnes commented 10 years ago

In particular, I'm thinking about the method that binds events to the field in order to revalidate after further input.

It just uses component/event blindly, but I think it could check that the input is an element before calling bind. Also, I figured it could also check if the input is an instance of EventEmitter and use Emitter#on() instead of bind.

ianstormtaylor commented 10 years ago

+1 that sounds really good