Giter VIP home page Giter VIP logo

Comments (3)

bblfish avatar bblfish commented on September 18, 2024

One thing that one could do is make algorithms typesafe, as for example I have been trying with the Fetch API.

Here things may be a bit different. I was thinking in this case algorithms for example could not be sealed traits, but it seems according to this stackoverflow article that it is not actually possible to discover supported algorithms in the browser. Still I suppose developers could integrate libraries that support them and ship those with the code....

from scala-js-dom.

mseddon avatar mseddon commented on September 18, 2024

When I initially PR'd the web crypto api, @sjrd suggested that we could use path dependent types to actually provide accurate types for all the promises, so I think it might be worth mapping out the various routes through the api. I believe we can produce accurate typing for the known algorithms, with a fallback to Promise[Any] when the user uses something we've not seen before. (And actually it's kind of a neat demo of what's possible with the Scala type system). I didn't do it at the time and have regretted it ever since :)

from scala-js-dom.

bblfish avatar bblfish commented on September 18, 2024

That sounds like a good idea. The above changes get me far enough to continue programming my implementation of http-signatures

from scala-js-dom.

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.