1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-19 16:42:09 +03:00

Add utils.inherits. Make User inherit EventEmitter.

utils.inherits is the Node.js impl but with the addition of a polyfill for
Object.create().
This commit is contained in:
Kegan Dougal
2015-06-11 11:37:43 +01:00
parent c737068fe7
commit eaa02cd2ad
3 changed files with 112 additions and 14 deletions

View File

@@ -2,6 +2,8 @@
/**
* @module models/user
*/
var EventEmitter = require("events").EventEmitter;
var utils = require("../utils");
/**
* Construct a new User. A User must have an ID and can optionally have extra
@@ -22,6 +24,7 @@ function User(userId) {
this.avatarUrl = null;
this.lastActiveAgo = 0;
}
utils.inherits(User, EventEmitter);
/**
* Update this User with the given presence event. May fire "User.presence",