https://github.com/huijari/moisture
Custom emitter for Most
https://github.com/huijari/moisture
mostjs reactive
Last synced: 5 months ago
JSON representation
Custom emitter for Most
- Host: GitHub
- URL: https://github.com/huijari/moisture
- Owner: huijari
- License: mit
- Created: 2017-02-05T16:00:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-05T16:31:36.000Z (over 9 years ago)
- Last Synced: 2025-09-22T12:28:57.616Z (9 months ago)
- Topics: mostjs, reactive
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# moisture
> Custom emitter for Most
## Examples of use
```js
import moist from 'moisture';
const stream = moist();
stream
.map(x => x * 2)
.observe(console.log.bind(console));
stream
.emit(1)
.emit(2)
.emit(3);
const value = moist();
value
.map(input => input.trim())
.observe(console.log.bind(console));
const input = h('input', {
oninput: e => value.emit(e.target.value)
});
```