Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IStackableCursor<IEventsList>

Type parameters

Hierarchy

Indexable

[key: string]: any

Index

Constructors

constructor

  • new IStackableCursor(id?: string): any
  • Parameters

    • Optional id: string

    Returns any

Properties

bundlesStack

bundlesStack: object

Type declaration

data

data: any

Data of cursor, changing at every cursor.apply()

emitter

emitter: EventEmitter

id

id: string

isDestroyed

isDestroyed: boolean

nextBundleIndex

nextBundleIndex: number

query

query: any

Abstract query for some source, which makes the source be able to send bundles to this cursor.

queryId

queryId: string

Unic id for every execution of query.

Methods

apply

destroy

  • destroy(): void
  • Returns void

emit

  • emit<IE>(eventName: IE, data: IEventsList[IE]): this
  • Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • data: IEventsList[IE]

    Returns this

exec

  • exec(query: any, data?: any): this

generateId

  • generateId(): string
  • Returns string

get

  • Get data by path from cursor.

    example
    import { Cursor } from 'ancient-cursor/lib/cursor';
    
    const cursor = new Cursor();
    cursor.exec(true, { a: [ { x: 2, b: 123 } ] });
    
    cursor.data; // { a: [ { x: 2, b: 123 } ] }
    
    cursor.get("a.0[b]"); // 123
    cursor.get(['a',0,'b']); // 123
    cursor.get(['a',{ x: 2 },'b']); // 123
    
    

    Parameters

    Returns any

off

  • off<IE>(eventName: IE, listener: function): this
  • Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

on

  • on<IE>(eventName: IE, listener: function): this
  • Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

once

  • once<IE>(eventName: IE, listener: function): this
  • Type parameters

    • IE: keyof IEventsList

    Parameters

    • eventName: IE
    • listener: function
        • (data: IEventsList[IE]): void
        • Parameters

          • data: IEventsList[IE]

          Returns void

    Returns this

parse

Generated using TypeDoc