remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
remix-project/src/registry.js

25 lines
538 B

// const moduleID = require('./module-id.js')
7 years ago
module.exports = class registry {
constructor () {
this.state = {}
}
put ({ api, name }) {
// const serveruid = moduleID() + '.' + (name || '')
if (this.state[name]) return this.state[name]
7 years ago
const server = {
// uid: serveruid,
api
7 years ago
}
this.state[name] = { server }
7 years ago
return server
}
get (name) {
// const clientuid = moduleID()
const state = this.state[name]
7 years ago
if (!state) return
const server = state.server
return server
7 years ago
}
}