real-cancellable-promise
rocketrpc
real-cancellable-promise | rocketrpc | |
---|---|---|
2 | 3 | |
32 | 154 | |
- | - | |
3.2 | 4.3 | |
7 months ago | 3 months ago | |
TypeScript | TypeScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
real-cancellable-promise
-
Are you sure you know Promises?
Even though #2 was the first and the result of #1 is ignored, #1 also ran to completion! In case process #1 must stop when process #2 "won" the race, then you need something like a cancellable promise! (There are other ways... You can do your own research by searching for "Why can't you cancel promises?").
-
Announcing real-cancellable-promise
Head on over to the README on GitHub for instructions on integrating your HTTP library with real-cancellable-promise and for more detailed examples.
rocketrpc
-
A library for going general PRC between threads and processes using high-level classes
The project is split into several packages, to allow for plugin new transforms. The main package is the packages/rpc package. On the “client side” the library works by using a Proxy, where it can intercept the Getter on an object, and then provides a wrapped function instead. It then waits for the arguments to be passed in, and passes them on to the underlying transport. At this point the message is passed through the transport, which then invokes the handleInvocation function. This function then accesses the underlying class and calls the actual function. Then it uses Promise.resolve to allow handling of both promises and non-promise responses. The result is then sent back to the client where it gets unwrapped and then resolves the client-side promise. Through this model any system which has a way of sending events with data can be used. Here I needed a WebWorker, so that is what I originally implemented, but there should be no problem with wrapping a WebSocket like https://github.com/akash-joshi/functions-without-borders is doing.
-
Functions without Boundaries - A typesafe library for making transparent RPC calls over websockets
Check the source code here: https://github.com/akash-joshi/functions-without-borders
- Functions without Borders - A typesafe RPC library thinning the boundaries between client and server
What are some alternatives?
msn-weather - ☀ A simple MSN Weather API wrapper with built-in TypeScript support.
threadbox - Recursive Worker Threads in NodeJS
react-modal-promise - Ease way to use React modal components as Promise
prray - "Promisified" Array, it compatible with the original Array but comes with async versions of native Array methods
wretch - A tiny wrapper built around fetch with an intuitive syntax. :candy:
livegollection-client - livegollection-client is the JavaScript/TypeScript client-side library to interact with the correspondant server-side Golang library livegollection.
ruls - 📏 Typesafe rules engine with JSON encoding.
react-query - 🤖 Powerful asynchronous state management, server-state utilities and data fetching for TS/JS, React, Solid, Svelte and Vue. [Moved to: https://github.com/TanStack/query]
worker-rpc
next-shopify-storefront - 🛍 A Shopping Cart built with TypeScript, Tailwind CSS, Headless UI, Next.js, React.js, Shopify Hydrogen React,... and Shopify Storefront GraphQL API.
wari - A type-safe way to create and handle errors.