Coder Social home page Coder Social logo

Comments (6)

json2d avatar json2d commented on June 19, 2024 1

I personally find the await fuzzy type handling helpful in some cases. Would be nice to preserve that behavior with to()

eg.

let fuzzyAsync = async (maybePromiseFn) => await maybePromiseFn()

from await-to-js.

agarwalkartik avatar agarwalkartik commented on June 19, 2024

@bitstrider Hey, I didn't understand you, can you be little more descriptive with "await fuzzy type" handling

from await-to-js.

json2d avatar json2d commented on June 19, 2024

@agarwalkartik I give a better example in the issue here #17 if that helps.

My argument is that the normal behavior when awaiting a non-promise type is to simply let the it pass through, and so this should be the same with on().

// the desired behavior
const A = await 42; //> 42
const [err, B] = await on(42); //> [null, 42]

from await-to-js.

agarwalkartik avatar agarwalkartik commented on June 19, 2024

@bitstrider Yes I agree, any ideas on how can we implement it in this library?

from await-to-js.

json2d avatar json2d commented on June 19, 2024

@agarwalkartik I ended up creating a new project to implement the feature since this project seems to be unmaintained https://github.com/bitstrider/await-on

from await-to-js.

scopsy avatar scopsy commented on June 19, 2024

Not exactly sure that the library should support this fuzziness. feel free to create your own helper function suited for your needs. This is library is about sharing a concept and the use of it should not be tied to specific implementation.

from await-to-js.

Related Issues (20)

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.