UNPKG

diffusion

Version:

Diffusion JavaScript client

18 lines (14 loc) 701 B
var BEES = require('serialisers/byte-encoded-enum-serialiser'); var Codec = require('io/codec'); var ConversationIDSerialiser = require('conversation/conversation-id-serialiser'); var TopicNotificationType = require('../../../features/topic-notifications').TopicNotificationType; var TopicDescendantEvent = require('services/topic-notifications/topic-notification-descendant-event'); var serialiser = { read : function(input) { var cid = ConversationIDSerialiser.read(input); var topicPath = Codec.readString(input); var type = BEES.read(input, TopicNotificationType); return new TopicDescendantEvent(cid, topicPath, type); } }; module.exports = serialiser;