![](https://github.com/screenshots/logo.flux.png)
![](https://camo.githubusercontent.com/c541a40190c43b2cc89d303cb1cf14cb58f6d9e21fc8b54028edcd5ca21e5237/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f4070726f6e69782f666c75782e737667)
A simple library for creating reactive applications using streams
// TypeScript + es6 modules
import Flux from '@pronix/flux'
interface Person {
name: string,
age: number,
sex: 'male' | 'female' | 'other'
}
const stream = new Flux<Person[]>([])
stream
.subscribe(
(data) => console.log(
data
.map(p => p.name)
.join('\n')
),
(data) => {}
// ...
)
.dispatch(
(data) => {
data.push({
name: 'pronix',
age: 25,
sex: 'male'
})
return data
}
// ...
)
// JavaScipt + require
const Flux = require('@pronix/flux').default
const stream = new Flux([])
stream
.subscribe(
(data) => console.log(
data
.map(p => p.name)
.join('\n')
),
(data) => {}
// ...
)
.dispatch(
(data) => {
data.push({
name: 'pronix',
age: 25,
sex: 'male'
})
return data
}
// ...
)