mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-21 13:36:40 +00:00
Cleanups
This commit is contained in:
parent
11dc672e31
commit
2bfa82e3e8
@ -43,8 +43,6 @@ class OrbitClient {
|
|||||||
|
|
||||||
_iterator(channel, password, options) {
|
_iterator(channel, password, options) {
|
||||||
const messages = this._getMessages(channel, password, options);
|
const messages = this._getMessages(channel, password, options);
|
||||||
|
|
||||||
// Iterator interface implementation
|
|
||||||
let currentIndex = 0;
|
let currentIndex = 0;
|
||||||
let iterator = {
|
let iterator = {
|
||||||
[Symbol.iterator]() {
|
[Symbol.iterator]() {
|
||||||
@ -59,6 +57,7 @@ class OrbitClient {
|
|||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
collect: () => messages
|
collect: () => messages
|
||||||
|
// TODO: add first() and last() ?
|
||||||
}
|
}
|
||||||
|
|
||||||
return iterator;
|
return iterator;
|
||||||
|
@ -88,7 +88,7 @@ async(() => {
|
|||||||
|
|
||||||
// Modes
|
// Modes
|
||||||
const password = 'hello';
|
const password = 'hello';
|
||||||
const channelModes;
|
let channelModes;
|
||||||
channelModes = orbit.channel(channel).setMode({ mode: "+r", params: { password: password } }); // { modes: { r: { password: 'hello' } } }
|
channelModes = orbit.channel(channel).setMode({ mode: "+r", params: { password: password } }); // { modes: { r: { password: 'hello' } } }
|
||||||
channelModes = orbit.channel(channel, password).setMode({ mode: "+w", params: { ops: [orbit.user.id] } }); // { modes: { ... } }
|
channelModes = orbit.channel(channel, password).setMode({ mode: "+w", params: { ops: [orbit.user.id] } }); // { modes: { ... } }
|
||||||
channelModes = orbit.channel(channel, password).setMode({ mode: "-r" }); // { modes: { ... } }
|
channelModes = orbit.channel(channel, password).setMode({ mode: "-r" }); // { modes: { ... } }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user