[JS] Implement adding and leaving channels.