BackgroundModule mahalo/change-detection/key-path

This module contains logic for watching key paths inside of objects.

Index

Functions

Functions

unwatch

  • unwatch(obj: Object, path?: string, callback?: Function): void
  • Remove a callback for a key path, remove all callbacks for a key pathinside of an object or unwatch the object entirely.

    See keyPath for more information about valid key paths.

    alias

    { unwatch } from mahalo

    Parameters
    • obj: Object
    • Optional path: string
    • Optional callback: Function
    Returns void

watch

  • watch(obj: Object, path: string, callback: Function): void
  • Watch a key path inside of an object and execute a givencallback when the value changes.

    See keyPath for more information about valid key paths.

    alias

    { watch } from mahalo

    Parameters
    • obj: Object
    • path: string
    • callback: Function
    Returns void