We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
in progress
Allow default args to bind to ambient authority, but always let the caller override them.
example sketch:
import dbOpenAmbient from 'better-sqlite3'; const getVatDetails = (misc, args, io = {}) { const { dbOpen = dbOpenAmbient, env = process.env, HOME = env.HOME, fullPath = swingStorePath.replace(/^~/, HOME), db = dbOpen(fullPath) } = io; ... use db ... }
That way, a caller can just pass in the db, or they can pass in env or HOME, or a mock dbOpen implementation, etc. etc.
env
HOME
A goal would be to remove the ambient authority completely, in due course, but that would be a breaking change. Hope to think this thru a bit more...
The text was updated successfully, but these errors were encountered:
a3p-proposals
z:acceptance
send-anywhere
No branches or pull requests
in progress
What is the Problem Being Solved?
Description of the Design
Allow default args to bind to ambient authority, but always let the caller override them.
example sketch:
That way, a caller can just pass in the db, or they can pass in
env
orHOME
, or a mock dbOpen implementation, etc. etc.Security Considerations
Scaling Considerations
Test Plan
Upgrade Considerations
A goal would be to remove the ambient authority completely, in due course, but that would be a breaking change. Hope to think this thru a bit more...
The text was updated successfully, but these errors were encountered: