How to use the grim.on function in grim

To help you get started, we’ve selected a few grim 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 atom / metrics / lib / metrics.js View on Github external
// Reports initial deprecations as deprecations may have happened before metrics activation.
      setImmediate(() => {
        for (let deprecation of grim.getDeprecations()) {
          this.reportDeprecation(deprecation)
        }
      })
    })

    atom.packages.onDidLoadPackage(pack => {
      if (!this.packageVersionCache[pack.name]) {
        this.packageVersionCache[pack.name] = getPackageVersion(pack)
      }
    })

    grim.on('updated', deprecation => {
      setImmediate(() => this.reportDeprecation(deprecation))
    })
  },
github atom / atom / packages / deprecation-cop / lib / deprecation-cop-view.js View on Github external
constructor({ uri }) {
    this.uri = uri;
    this.subscriptions = new CompositeDisposable();
    this.subscriptions.add(
      Grim.on('updated', () => {
        etch.update(this);
      })
    );
    // TODO: Remove conditional when the new StyleManager deprecation APIs reach stable.
    if (atom.styles.onDidUpdateDeprecations) {
      this.subscriptions.add(
        atom.styles.onDidUpdateDeprecations(() => {
          etch.update(this);
        })
      );
    }
    etch.initialize(this);
    this.subscriptions.add(
      atom.commands.add(this.element, {
        'core:move-up': () => {
          this.scrollUp();
github atom / atom / src / task-bootstrap.js View on Github external
const setupDeprecations = function() {
  const Grim = require('grim');
  return Grim.on('updated', function() {
    const deprecations = Grim.getDeprecations().map(deprecation =>
      deprecation.serialize()
    );
    Grim.clearDeprecations();
    return global.emit('task:deprecations', deprecations);
  });
};

grim

Log usage of deprecated methods

MIT
Latest version published 4 years ago

Package Health Score

51 / 100
Full package analysis