digitalinteraction / deconf-api-toolkit

A library for running decentralised virtual conferences
https://deconf-api.openlab.dev/
MIT License
2 stars 0 forks source link

Explore standardising "options" for DI classes #44

Open robb-j opened 2 years ago

robb-j commented 2 years ago

There could be a standard options key in every context, or a second argument to keep the context clean.

non-standard containers:

e.g.

type Context = Pick<DeconfBaseContext, 'jwt' | 'semaphore'> & {
  options: { someBespokeConfig: true }
}

// or

type Context = Pick<DeconfBaseContext, 'jwt' | 'semaphore'>
interface Options {
  someBespokeConfig: true
}

class Something {
  #context: Context
  #options Options
  constructor(context: Context, options: Options) {
    this.#context = context
    this.#options = options
  }
}