deepstream.io List subscribe() not triggering

108 Views Asked by At

using deepstream.io: 3.1.1 and deepstream.io-client-js: 2.3.0 updates on List are not propagating when using list.addEntry('some-id'), instead to get notifications of changes I must use list.setEntries([..., 'some-id'])

example:

client 1: (after connecting and authenticating with server)

cars = deepstreamClient.record.getList('cars/all')

client 2: (after connecting and authenticating with server)

cars = deepstreamClient.record.getList('cars/all')
cars.subscribe(console.log)

now client 2 will print all changes to cars list, for instance:

client 1: cars.setEntries(['porche','ferrari','bmw']) makes client 2 print ['porche','ferrari','bmw'].

However simply adding an item to the cars list in client 1: cars.addEntry('audi') only changes the cars list in client 1; client 2 is unaware of the change and no notification is triggered.

0

There are 0 best solutions below