Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tdreyno/pretty-please

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tdreyno/pretty-please

Pretty Please is a TypeScript library provides Tasks an alternative to Promises.

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
512
decreased by-18.73%
Maintainers
1
Weekly downloads
 
Created
Source

Pretty Please

Pretty Please is a TypeScript library provides Tasks an alternative to Promises.

Documentation of this project is a work in progress. For now, take a look at the example below and lean heavily on TypeScript's information around the public API.

Installation

Yarn

yarn add @tdreyno/pretty-please

NPM

npm install --save @tdreyno/pretty-please

Examples

const getFriendsNames = id =>
  // Load data.
  Task.fromPromise(fetch(`/user/${id}.json`))

    // Parse JSON text into valid Person type.
    .chain(parseUserData)

    // Load all of a user's friends in parallel.
    .chain(user =>
      user.friends
        .map(id => HTTP.get(`/user/${id}.json`).chain(parseUserData))
        .chain(Task.all)
    )

    // Map to an array of friend's names.
    .map(friends => friends.map(f => f.name));

// Prepares the task, but does not run anything.
const task = getFriendsNames(1);

// Run the task.
task.fork(
  e => console.error(e),
  names => console.log("Friend names", names)
);

License

Pretty Please is licensed under the the Hippocratic License. It is an Ethical Source license derived from the MIT License, amended to limit the impact of the unethical use of open source software.

FAQs

Package last updated on 24 Dec 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc