Skip to content

fp-js/fj-always

Repository files navigation

fj-always

Build Status npm version

Create a function which always returns a given value.

Installation

npm install fj-always --save

Usage

var always = require('fj-always');

var sayHello = always('hello');

sayHello(); // => 'hello'
sayHello(true); // => 'hello'
sayHello(false); // => 'hello'
sayHello('foo'); // => 'hello'

API

always

Return always a given value.

always(value)

Parameters

Name Type Description
value * The value that should be returned always

Returns

Type Description
function A function that always returns value

About

Create a function which always returns a given value.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published