Closed Bug 885667 Opened 11 years ago Closed 11 years ago

Add observers to Places API

Categories

(Add-on SDK Graveyard :: General, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jsantell, Assigned: jsantell)

References

Details

Attachments

(1 file)

No description provided.
Attached file GH PR 1136 (deleted) —
Exposes a composable event emitter for low level usage let { events } = require('sdk/places/events'); events.on('bookmark-item-added', handler); filter(events, ({type}) => /bookmark/.test(type)).on('data', handler);
Attachment #781939 - Flags: review?(rFobic)
Attachment #781939 - Flags: review?(rFobic) → review-
Made all the changes from the PR, other than the event naming stuff. We should decide if these are `on(events, 'data', () => )` or `on(events, 'bookmark-item-added', () =>)`. One is easier for composability, and the other for one-off event listeners. Either way, we should stick to one while moving forward if we have to limit it to one, as both styles are used the SDK currently.
Flags: needinfo?(rFobic)
I take it back -- we should have 'data' events for the low level API, and for the high-level abstraction in the bookmark/history module, just have `require('sdk/places/bookmarks').on('bookmark-item-added', () =>)`
Comment on attachment 781939 [details] GH PR 1136 Resubmitting, using 'data' events as low level events, and we can use another abstraction for high level ones when implemented
Attachment #781939 - Flags: review- → review?(rFobic)
Flags: needinfo?(rFobic)
Comment on attachment 781939 [details] GH PR 1136 Proposed some suggestions, but don't feel very strong about them.
Attachment #781939 - Flags: review?(rFobic) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: