
class Store {}
const store = new Store()
// Пример использования
const firstSubscriber = (data) => console.log('first', data)
const secondSubscriber = (data) => console.log('second', data)
store.subscribe(firstSubscriber)
store.subscribe(secondSubscriber)
store.data = {newKey: 'newString'}
// CONSOLE
// first { newKey: 'newString' }
// second { newKey: 'newString' }
store.unsubscribe(firstSubscriber)
store.data = {lastKey: 'lastKey'}
// CONSOLE
// second { lastKey: 'lastKey' }