mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
25 lines
561 B
JavaScript
25 lines
561 B
JavaScript
|
/**
|
||
|
* @typedef {object} MemberSubscribeEventData
|
||
|
* @prop {string} memberId
|
||
|
* @prop {string} source
|
||
|
*/
|
||
|
|
||
|
module.exports = class MemberSubscribeEvent {
|
||
|
/**
|
||
|
* @param {MemberSubscribeEventData} data
|
||
|
* @param {Date} timestamp
|
||
|
*/
|
||
|
constructor(data, timestamp) {
|
||
|
this.data = data;
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param {MemberSubscribeEventData} data
|
||
|
* @param {Date} [timestamp]
|
||
|
*/
|
||
|
static create(data, timestamp) {
|
||
|
return new MemberSubscribeEvent(data, timestamp || new Date);
|
||
|
}
|
||
|
};
|