JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 158
  • Score
    100M100P100Q95406F
  • License MIT

Package Exports

  • functionally

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (functionally) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Functionally

Usage

npm install functionally
var F = require('functionally')

function log(msg){
    console.log(msg)
}

function greet(name){
    return 'Hello ' + name + '!'
}

var logGreeting = F.compose(log, greet)

logGreeting('Bob') //console.log('Hello Bob!')

once(fn)

Returns a function that calls fn just once.

Example

var counter = 0

var inc = F.once(function(){
    counter++
})

inc()
counter == 1

inc()
inc()

counter == 1

The function returned by once returns the result of the original function. On subsequent calls, returns the same result.