Adds a listener function. The listener will be returned when using applyPatch.
Function
The callback to be invoked after patching.
Function
OptionalAn optional function that filters what mutations have to be applied.
Function
A function that unsubscribes.
import { createStore } from 'dop'
const store = createStore({ users: 0 })
const unsubscribe = store.subscribe(patch => {})
store.listeners.size // 1
unsubscribe()
store.listeners.size // 0