From aca77e924549c03216b6e1724f9c061d1817cb80 Mon Sep 17 00:00:00 2001 From: Priyank Patel Date: Tue, 18 Aug 2020 18:07:41 +0000 Subject: [PATCH] js: Convert pm_conversations module to ES6. This was converted automatically using a jscodeshift script followed by running eslint and prettier to convert let -> const (whenever applicable) and removing "use strict;". --- static/js/pm_conversations.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/static/js/pm_conversations.js b/static/js/pm_conversations.js index d8dcd5d172..bc8d0bbef1 100644 --- a/static/js/pm_conversations.js +++ b/static/js/pm_conversations.js @@ -1,17 +1,15 @@ -"use strict"; - -const FoldDict = require("./fold_dict").FoldDict; -const people = require("./people"); +import {FoldDict} from "./fold_dict"; +import * as people from "./people"; const partners = new Set(); -exports.set_partner = function (user_id) { +export function set_partner(user_id) { partners.add(user_id); -}; +} -exports.is_partner = function (user_id) { +export function is_partner(user_id) { return partners.has(user_id); -}; +} class RecentPrivateMessages { // This data structure keeps track of the sets of users you've had @@ -77,4 +75,4 @@ class RecentPrivateMessages { } } -exports.recent = new RecentPrivateMessages(); +export const recent = new RecentPrivateMessages();