Skip to content

Raynos/form-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

form-stream

A delta stream which emits deltas from form elements

Example

Create a stream from an element that contains form elements. It will listen on keyup for the input fields and emit a change based on the data attribute and the field value

var FormStream = require("form-stream")
    , someElement = document.getElementById("thing")

var stream = FormStream(someElement)

stream.on("data", function (data) {
    var changes = data[0]

    /* changes is 
        { foo: "b" } 
        { foo: "ba" } 
        { foo: "bar" } 
    */
})
<div id="thing">
    <input data-foo placholder="write bar in here"/>
</div>

Installation

npm install form-stream

Contributors

  • Raynos

MIT Licenced

About

A delta stream which emits deltas from form elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published