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.0.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
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

import { HTTP } from "@tdreyno/pretty-please";

const getFriendsNames = id =>
  HTTP
    // Load data.
    .get(`/user/${id}.json`)

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

    // Load all of a user's friends in parallel.
    .andThen(user =>
      user.friends
        .map(id => HTTP.get(`/user/${id}.json`).andThen(parseUserData))
        .andThen(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 06 Nov 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