Skip to content

bekzod/ember-observer-macros

Repository files navigation

ember-observer-macros Ember Observer Score npm version travis status

Adds few observer macros to avoid calling observer function too often

Importing/ Usage

import { observerOnce, observerDebounce, observerThrottle } from 'ember-observer-macros';

observerOnce

Calls observer function once in run loop

nameChanged: observerOnce('propName1', 'propName2', function() {})

observerDebounce

Debounces observer function

nameChanged: observerDebounce('propName1', 'propName2', function() {}, 200)

observerThrottle

Throttles observer function

nameChanged: observerThrottle('propName1', 'propName2', function() {}, 200)

Installation

  • ember install ember-observer-macros