0.2.0 • Published 4 years ago

@zaibot/fsa v0.2.0

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

@zaibot/fsa Coverage Status Build Status

Easy type checked Flux Standard Action for TypeScript

Installation

npm i -S @zaibot/fsa

Usage

import { Action, isType } from '@zaibot/fsa';

export const HELLO_WORLD = Action<{ message: string; }>('HELLO_WORLD');

const action = HELLO_WORLD({ message: 'Hello World!' });
if (isType(action, HELLO_WORLD)) {
    console.log(action.payload.message);
}
import { Action, isTypeOneOf } from '@zaibot/fsa';

export const HELLO_WORLD = Action<{ message: string; }>('HELLO_WORLD');
export const WELCOME_MESSAGE = Action<{ message: string; }>('WELCOME_MESSAGE');

const action = HELLO_WORLD({ message: 'Hello World!' });
if (isTypeOneOf(action, HELLO_WORLD, WELCOME_MESSAGE)) {
    console.log(action.payload.message);
}
0.2.0

4 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago