Options
All
  • Public
  • Public/Protected
  • All
Menu

External module Cuff

Index

Interfaces

Functions

Functions

cuff

  • cuff(objA: object, propA: string, objB: object, propB: string): void
  • Property propA of object objA is hand-cuffed with property propB of object objB - when one changes, both change

    Parameters

    • objA: object
    • propA: string
    • objB: object
    • propB: string

    Returns void

follow

  • follow(objFr: object, propFr: string, objFd: object, propFd: string): void
  • "Follower"[Fr] property propFr of object objFr is set when "followed"[Fd] property propFd of object objFd is changed

    Parameters

    • objFr: object
      • [prop: string]: any
    • propFr: string
    • objFd: object
      • [prop: string]: any
    • propFd: string

    Returns void

onGet

  • onGet(obj: object, prop: string, cb?: function): OldGetter
  • Calls cb after getting the value each time the property prop of object obj is retrieved. If cb returns a defined value, this value is returned instead of the originally retrieved value.

    Parameters

    • obj: object
    • prop: string
    • Optional cb: function
        • (v: any, scope: object, prop: string): any
        • Parameters

          • v: any
          • scope: object
          • prop: string

          Returns any

    Returns OldGetter

    A function without this scope that sets the value of obj[prop] without calling cb

onSet

  • onSet(obj: object, prop: string, cb?: function): OldSetter
  • Calls cb before setting the value each time the property prop of object obj is set.

    Parameters

    • obj: object
    • prop: string
    • Optional cb: function
        • (v: any, scope: object, prop: string): boolean | void
        • Parameters

          • v: any
          • scope: object
          • prop: string

          Returns boolean | void

    Returns OldSetter

    A function without this scope that sets the value of obj[prop] without calling cb

Generated using TypeDoc