-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
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
Switch to Hyperdb #2
Conversation
index.js
Outdated
@@ -105,6 +114,34 @@ class Autopass extends ReadyResource { | |||
this.pairing = null | |||
this.replicate = opts.replicate !== false | |||
this.debug = !!opts.key | |||
// Register handlers for commands | |||
this.router.add('@autopass-namespace/removeWriter', async (data, context) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the -namespace is redundant, just @autopass/remove-writer
index.js
Outdated
// Register handlers for commands | ||
this.router.add('@autopass-namespace/removeWriter', async (data, context) => { | ||
await context.base.removeWriter(data.key) | ||
return { success: true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dont return anything
index.js
Outdated
|
||
this.router.add('@autopass-namespace/put', async (data, context) => { | ||
await context.view.insert('@autopass-namespace/autopass', data) | ||
await context.view.flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move the flush to the apply call post router dispatch, same for all flushes
index.js
Outdated
if (node === null) return null | ||
return node.value | ||
const queryStreams = await this.base.view.get('@autopass-namespace/autopass', { key }) | ||
const data = await queryStreams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes no sense, just data = await this....get(...)
schema.js
Outdated
|
||
// SCHEMA CREATION START // | ||
const schemaTemplate = Hyperschema.from('./spec/schema') | ||
const templateNamespace = schemaTemplate.namespace('autopass-namespace') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name this autopass vs template...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by this?
index.js
Outdated
@@ -173,6 +165,7 @@ class Autopass extends ReadyResource { | |||
for (const node of nodes) { | |||
await this.router.dispatch(node.value, { view, base }) | |||
} | |||
view.flush() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await
No description provided.