Pear platform and application update notifications
import updates from 'pear-updates'const stream = updates()
stream.on('data', (update) => {
const { app, version, info, updating, updated } = update
//...
})updates((update) => {
const { app, version, info, updating, updated } = update
//...
})Pattern match against update properties to listen for specific kinds of updates:
const appUpdates = updates({ app: true })
appUpdates.on('data', (update) => {
const { app, version, info, updating, updated } = update
//...
})
const pearUpdates = updates({ app: false })
pearUpdates.on('data', (update) => {
const { app, version, info, updating, updated } = update
//...
})
const appUpdating = updates({ app: true, updating: true })
appUpdating.on('data', (update) => {
const { app, version, info, updating, updated } = update
//...
})
const pearUpdated = updates({ app: false, updated: true })
pearUpdated.on('data', (update) => {
const { app, version, info, updating, updated } = update
//...
})Apache-2.0