lib/components/state-lookup.js
function StateLookup(opts) {
    if (!opts.client) {
        throw new Error("client property must be supplied");
    }

    this._client = opts.client;
    this._eventTypes = {}; // store it as a map
    var self = this;
    (opts.eventTypes || []).forEach(function(t) {
        self._eventTypes[t] = true;
    });

    this._dict = {
        // $room_id: {
        //   syncPromise: Promise,
        //   events: {
        //     $event_type: {
        //       $state_key: { Event }
        //     }
        //   }
        // }
    };
}
function StateLookup(opts) {
    if (!opts.client) {
        throw new Error("client property must be supplied");
    }

    this._client = opts.client;
    this._eventTypes = {}; // store it as a map
    var self = this;
    (opts.eventTypes || []).forEach(function(t) {
        self._eventTypes[t] = true;
    });

    this._dict = {
        // $room_id: {
        //   syncPromise: Promise,
        //   events: {
        //     $event_type: {
        //       $state_key: { Event }
        //     }
        //   }
        // }
    };
}
function StateLookup ( opts ) { if ( ! opts . client ) { throw new Error ( "client property must be supplied" ) ; } this . _client = opts . client ; this . _eventTypes = { } ; // store it as a map var self = this ; ( opts . eventTypes || [ ] ) . forEach ( function ( t ) { self . _eventTypes [ t ] = true ; } ) ; this . _dict = { // $room_id: { //   syncPromise: Promise, //   events: { //     $event_type: { //       $state_key: { Event } //     } //   } // } } ; }
Construct a new state lookup entity.

This component stores state events for specific event types which can be
queried at a later date. This component will perform network requests to
fetch the current state for a given room ID. It relies on
{@link StateLookup#onEvent} being called with later events in order to
stay up-to-date. This should be connected to the <code>onEvent</code>
handler on the {@link Bridge}.
@constructor
@param {Object} opts Options for this constructor
@param {MatrixClient} opts.client Required. The client which will perform
/state requests.
@param {string[]} opts.eventTypes The state event types to track.
@throws if there is no client.
Construct a new state lookup entity .