Skip to main content

Class SpaceList

About 2 min

Class SpaceList

Declared in packages/sdk/client/src/echo/space-list.ts:46open in new window

TODO(burdon): Public API (move comments here).

Constructors

constructor(_config, _serviceProvider, _graph, _getIdentityKey)open in new window

Returns: SpaceList

Arguments:

_config: undefined | Config

_serviceProvider: ClientServicesProvider

_graph: Hypergraph

_getIdentityKey: function

Properties

_value

Type: Space[]

defaultopen in new window

Type: Space

Returns the default space.

isReadyopen in new window

Type: MulticastObservable<boolean>

Resolves when the default space is available.

Methods

[custom]()open in new window

Returns: string

Arguments: none

[observable]()

Returns: Observable<Space[]>

Arguments: none

addSchema(schema)open in new window

Returns: void

Arguments:

schema: TypeCollection

concat(observables)

Returns: MulticastObservable<R>

Arguments:

observables: Observable<R>[]

create([meta])open in new window

Creates a new space.

Returns: Promise<Space>

Arguments:

meta: PropertiesProps

filter(callback)

Returns: MulticastObservable<Space[]>

Arguments:

callback: function

flatMap(callback)

Returns: MulticastObservable<R>

Arguments:

callback: function

forEach(callback)

Returns: Promise<void>

Arguments:

callback: function

get(spaceKey)open in new window

Returns the space with the given key.

Returns: undefined | Space

Arguments:

spaceKey: PublicKey

join(invitation)open in new window

Joins an existing space using the given invitation.

Returns: AuthenticatingInvitation

Arguments:

invitation: string | Invitation

losslessConcat(reducer, observables)

Concatenates multicast observables without losing the current value.

Returns: MulticastObservable<R>

Arguments:

reducer: function

observables: Observable<R>[]

map(callback)

Returns: MulticastObservable<R>

Arguments:

callback: function

query([filter], [options])open in new window

Query all spaces.

Returns: Query<T>

Arguments:

filter: FilterSource<T>

options: QueryOptions

reduce(callback, [initialValue])

Returns: MulticastObservable<R>

Arguments:

callback: function

initialValue: R

setIndexConfig(config)open in new window

Returns: Promise<void>

Arguments:

config: IndexConfig

subscribe(onNext, [onError], [onComplete])

Returns: Subscription

Arguments:

onNext: function

onError: function

onComplete: function

toJSON()open in new window

Returns: object

Arguments: none

wait([options])

Wait for the observable to complete.

Returns: Promise<Space[]>

Arguments:

options: object

empty()

Returns: MulticastObservable<"null">

Arguments: none

from(value, [initialValue])

Returns: MulticastObservable<T>

Arguments:

value: Observable<T> | ObservableLike<T> | ArrayLike<T> | Event<T>

initialValue: T

of(items)

Returns: MulticastObservable<T>

Arguments:

items: T[]