🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

create-fsa

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-fsa

Create a flux-standard-action from a value

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

create-fsa

NPM version build status Test coverage Downloads js-standard-style

Create a flux-standard-action from a value.

Installation

$ npm install create-fsa

Usage

const createFsa = require('create-fsa')

const square('square', {
  payload: val => val * val,
  meta: val => { original: val },
  error: val => val >= 0
})

square(3)
// => {
// =>   type: 'square',
// =>   payload: 9,
// =>   meta: { original: 3 },
// =>   error: false
// => }

API

creator = createFsa(type, fns)

Create an action creator with a type. Takes an optional object of functions to create FSA properties (payload, meta, error). If no payload function is passed, the payload defaults to the passed in value.

fsa = creator(value)

Create a flux-standard-action from a value.

See Also

  • flux-standard-action - human-friendly standard for Flux action objects
  • barracks - action dispatcher for unidirectional data flows

License

MIT

Keywords

flux-standard-action

FAQs

Package last updated on 29 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts