BackgroundModule mahalo/change-detection/key

This module holds logic for observing keys of objects.

Index

Functions

executeCallbacks

  • executeCallbacks(obj: Object, key: string | number, oldValue: any): void
  • Execute all callbacks that were registered for a provided objectand key.

    Parameters
    • obj: Object
    • key: string | number
    • oldValue: any
    Returns void

hasCallbacks

  • hasCallbacks(obj: any): boolean
  • Checks if an object is observed.

    Parameters
    • obj: any
    Returns boolean

observe

  • observe(obj: Object | Scope, key: string | number, callback: Function): void
  • Makes sure a provided key is observed inside of an object andadds a callback for that key.

    Parameters
    • obj: Object | Scope
    • key: string | number
    • callback: Function
    Returns void

scheduleCheck

  • scheduleCheck(): void
  • Schedules dirty checking of computed properties.

    Returns void

unobserve

  • unobserve(obj: Object, key: string | number, callback: Function): void
  • Removes a callback for a provided key from an object.

    Parameters
    • obj: Object
    • key: string | number
    • callback: Function
    Returns void