Home Reference Source
import {ConversationSorting} from 'js-chat-demo/utils/ManagedConversationList.jsx'
public class | source

ConversationSorting

Convenience class to create Conversation compare functions for sorting. It's just a regular compare function that expects 2 Conversation records.

Example:

new ConversationSorting('title','ascending')
=> function(a,b) { ... }

Constructor Summary

Public Constructor
public

constructor(attribute: string, order: string)

Public Constructors

public constructor(attribute: string, order: string) source

Params:

NameTypeAttributeDescription
attribute string

The attribute to sort by, currently supports: 'title', 'last update', 'create time' and 'participant count'.

order string

Sorting order, expects either 'ascending' or 'descending'.