Coder Social home page Coder Social logo

posva / p-singleton Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 0.0 706 KB

Ensure only one instance of a promise is created until rejected or resolved

License: MIT License

JavaScript 88.51% TypeScript 11.49%
async-functions promises javascript nodejs promise promise-modules

p-singleton's Introduction

p-singleton's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar posva avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

p-singleton's Issues

Use Function.apply instead of Function.call

Shouldn't this:

const promise = fn.call(this, args)

instead be this?

const promise = fn.apply(this, args)

That way you don't have to manually unpack the arguments inside the callee.

SyntaxError on IE11

As Babel is not applied to node_modules usually in most of projects this package is not transpiled and throws an error in browsers that do not support modern EcmaScript.

Even if it will be included to Babel it will fail in Webpack because Babel with option presets: [ ['@babel/preset-env', { useBuiltins: 'usage'}] ] will add import 'core-js/some-polyfill to almost every file including this package. This produces a sutation when we have import and module.exports in a single file which is a known problem. Webpack will switch to strict mode and not allow to modify module.exports. This package will throw an error that module.exports is read-only

Possible solutions:

  • The best solution I see is to manually rewrite everything to ES5. Fortunatly the code base is not large
  • Add build tasks with transpilation and publish built code

Lets discuss and I can help with an implementation

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency jest to ^27.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.