1.0.1 • Published 8 years ago

const-func v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

const-func

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Create a function always returning a constant

Like Elm's always

Install

npm install --save const-func

Usage

import always from 'const-func'

const alwaysUndefined = always()
alwaysUndefined()
  // => undefined

const always3 = always(3)
always3()
  // => 3

const alwaysHi = always('hi')
alwaysHi('whatever')
  // => 'hi'

API

always(arg)

Returns a function that always returns a constant value.

arg

type: *

default: undefined

The constant value to always return from the constant function.

LICENSE

MIT © Dustin Specker

1.0.1

8 years ago

1.0.0

8 years ago