New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ember-decorators-runloop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-decorators-runloop

The default blueprint for ember-cli addons.

latest
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

runloop

Usage

Installation

ember install @ember-decorators/runloop

debounce

In your application where you use ES6 classes:

import Component from '@ember/component';
import { debounce } from "@ember/runloop";
import { action } from "@ember-decorators/object";

export default class TypeAhead extends Component {
  fetchResults(searchValue) {
    ...
  },

  @action
  handleTyping() {
    debounce(this, get(this, 'fetchResults'), get(this, 'searchValue'), 250);
  }
}

You replace it with this:

import Component from '@ember/component';
import { debounce } from "@ember-decorators/runloop";
import { action } from "@ember-decorators/object";

export default class TypeAhead extends Component {
  @debounce(250)
  fetchResults(searchValue) {
    ...
  },

  @action
  handleTyping() {
    get(this, 'fetchResults')(get('searchValue'));
  }
}

throttle

In your application where you use ES6 classes:

import Component from '@ember/component';
import { throttle } from "@ember/runloop";
import { action } from "@ember-decorators/object";

export default class TypeAhead extends Component {
  fetchResults(searchValue) {
    ...
  },

  @action
  moveMouse() {
    throttle(this, get(this, 'fetchResults'), get(this, 'searchValue'), 250);
  }
}

You replace it with this:

import Component from '@ember/component';
import { throttle } from "@ember-decorators/runloop";
import { action } from "@ember-decorators/object";

export default class TypeAhead extends Component {
  @throttle(250)
  fetchResults(searchValue) {
    ...
  },

  @action
  moveMouse() {
    get(this, 'fetchResults')(get('searchValue'));
  }
}

schedule

In your application where you use ES6 classes:

import Component from '@ember/component';
import { schedule } from "@ember/runloop";

export default class TypeAhead extends Component {
  fetchResults(searchValue) {
    ...
  },

  didInsertElement() {
    schedule('afterRender', this, get(this, 'fetchResults'), get(this, 'searchValue'));
  }
}

You replace it with this:

import Component from '@ember/component';
import { schedule } from "@ember-decorators/runloop";

export default class TypeAhead extends Component {
  @schedule('afterRender')
  fetchResults(searchValue) {
    ...
  },

  didInsertElement() {
    get(this, 'fetchResults')(get('searchValue'));
  }
}

This README outlines the details of collaborating on this Ember addon.

Installation

  • git clone <repository-url> this repository
  • cd runloop
  • npm install

Running

  • ember serve
  • Visit your app at http://localhost:4200.

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

Keywords

ember-addon

FAQs

Package last updated on 30 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts