-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General purpose notification service #68
Conversation
I like this. I'll merge it tonight. pushFixed(message, type='info') The add... methods return a notification object you can use to remove. More controversially, each notification object could have a clear function on it that you could use to remove itself from the service. This would be good in the UI because you could simply pass it a reference to the all() method and then it could clear messages as they were read off. What do you think? Pete |
I see from where you are coming, had similar thoughts. To answer your questions:
Would be cool if we could get it to the repo today as it would unblock several other issues (I'm working on the i18n messages service atm). So I will do the changes we have discussed here and will push another commit. Then you will either merge it or push another commit with corrections. How does it sound? |
Ok. I will be online in 2 hours Pete
|
@petebacondarwin Pushed a new commit wit some changes, please have a look, review and change if needed. As soon as we've got both notifications and i18n service we will be able to progress a lot on the app, making its UI more 'reactive' and i18n ready! |
… into their own objects
Hi Pawel On 20 October 2012 22:01, Pawel Kozlowski notifications@github.com wrote:
|
@petebacondarwin Sorry, was to tired to respond yesterday. And I'm not too worried about the pushing 2 versions, at least we are able to discuss with the code examples! I just had a fresh look at your proposal and I (mostly) like your API, provided that we do focus on string messages only for now (which should be enough). I will add some more comments to the code. I'm a bit concerned with the implementation thought... It looks "cleaner" but got over 2x bigger compared to the initial one... without bringing new flexibility (I'm not even sure we want / need more flexibility at this point...). The bottom line for me is that impl got harder to understand (arguably) without bringing much more flexibility (but I might have missed things!). Going to comment more in the code itself. |
I am happy to go with $remove. It fits with the Angular way. |
Happy to lose the current/all and just go with one method. current or all? |
I am not keen on using dependency style injections. It feels too magical to me. |
Two benefits of this implementation is that we could turn it into a provider/service model where people could configure their own notification lists in addition to the standard ones very easily. Also I meant to expose each queue on the service with a method call - e.g. stickyNotifications(), currentRouteNotifications() and nextRouteNotifications(), which would allow direct access to those nice methods on the list directly for more fine grained work. I agree it does appear more complex to the casual observer. Let me know what you would prefer to do. I am fairly relaxed about it. Pete |
Thnx for all the comments / responses to my comments! For me the most important part is that we've got the interface right (after removing For the implementation itself - I don't mind either way. Don't want to spend too much time on it right now as somehow this is rather basic service. So going to do the changes we've discussed and merge it. We will see if we need any additional flexibility as we go and refactor accordingly. |
Landed as 6507541 |
Should address #67
Made it a bit more general, so we could push any type of objects. A notification will be removed based on a category to which it was pushed.
This could be further extended (for example to evict notifications using the
$timeout
service) and probably coded in the way that is more generic but since we don't have any uses-cases for this right now the current version should do.@petebacondarwin please review / comment / merge.