How to use the mnemonist/multi-map function in mnemonist

To help you get started, we’ve selected a few mnemonist examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hashicorp / consul / ui-v2 / app / services / blocking.js View on Github external
cb();
      }
      return res;
    });
  };
};
const ifNotBlocking = function(settings) {
  return settings.findBySlug('client').then(res => !res.blocking);
};

// TODO: Expose this as a env var
const cache = new Map();
// sources are 'manually' removed when closed,
// they are only closed when the usage counter is 0
const sources = new Map();
const refs = new MultiMap(Set);

export default Service.extend({
  // TODO: Temporary repo list here
  service: service('repository/service'),
  node: service('repository/node'),
  session: service('repository/session'),

  client: service('client/http'),
  settings: service('settings'),
  // TODO: Temporary finder
  finder: function(src, filter) {
    const temp = src.split('/');
    temp.shift();
    const slug = temp.pop();
    const model = temp.pop();
    const dc = temp.shift();
github hashicorp / consul / ui / packages / consul-ui / app / services / data-source / service.js View on Github external
init() {
    super.init(...arguments);
    cache = new Map();
    sources = new Map();
    usage = new MultiMap(Set);
    this._listeners = this.dom.listeners();
  }
github hashicorp / consul / ui-v2 / app / services / data-source / service.js View on Github external
init: function() {
    this._super(...arguments);
    cache = new Map();
    sources = new Map();
    usage = new MultiMap(Set);
    this._listeners = this.dom.listeners();
  },
  resetCache: function() {

mnemonist

Curated collection of data structures for the JavaScript/TypeScript.

MIT
Latest version published 3 months ago

Package Health Score

85 / 100
Full package analysis