1.0.10 • Published 4 years ago

@pronix/flux v1.0.10

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

npm.io

Flux.js

npm.io npm.io

A simple library for creating reactive applications using streams

Getting started

installation:

$ yarn add @pronix/flux

using:

// 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
        }
        // ...
    )
1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago