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

24 lines
538 B

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