![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Life is too short to wait for "ready" callbacks. Q up method calls and execute when ready.
Life is too short to wait for "ready" callbacks. Q up method calls and execute when ready.
const Q = require('q-method')
function Database (config) {
this.connection = new DBConnection(config)
this.connection.on('connect', () => {
// execute all queued method calls and begin normal operation
Q.ready(this)
})
}
// wrap method definitions with Q to defer execution until Q.ready is called
Database.prototype.findUser = Q(function (userid) {
return this.connection.query({userid})
})
// new Database() is "synchronous"
const DB = new Database()
// able to call methods on it immediately
DB.findUser('thelegend97').then(user => {
console.log(user)
})
Q-methods return Promises that will eventually resolve once the resource is ready. After the
resource is ready, methods execute as written. From the caller's perspective, the behavior is
the same before and after Q.ready
is called, always returning a Promise.
Wrapped methods must be async functions or return a Promise or Promise-like object.
Q(Function method)
Wraps a method to be queued or executed. Takes a method that returns a Promise and returns a method that returns a Promise.
Q.ready(Instance instance)
Marks an instance as "ready", executing all queued method calls. Changes behavior of subsequent method calls to be invoked immediately rather than queued.
Q.wait(Instance instance)
Unmarks an instance as "ready", changing behavior back to queueing until Q.ready
is called
again.
Q.isReady(Instance instance)
Returns true
if an instance is marked as "ready" or false
if it is waiting.
Bug reports, feature requests, and questions are all welcome: open a GitHub issue and I'll get back to you.
FAQs
Life is too short to wait for "ready" callbacks. Q up method calls and execute when ready.
The npm package q-method receives a total of 1 weekly downloads. As such, q-method popularity was classified as not popular.
We found that q-method demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.