aboutsummaryrefslogtreecommitdiff
path: root/src/components/notifications/notifications.js
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2016-11-27 19:44:56 +0100
committerRoger Braun <roger@rogerbraun.net>2016-11-27 19:44:56 +0100
commite8c85434b7b884a9fa398d75694691548bc35aa3 (patch)
treed5b2ff0ad99af9087e664c27588522c60753aa08 /src/components/notifications/notifications.js
parente1c50303112713c83e15c9d71cf6a5af737458e3 (diff)
Add basic notification support.
Diffstat (limited to 'src/components/notifications/notifications.js')
-rw-r--r--src/components/notifications/notifications.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js
new file mode 100644
index 00000000..10f987a8
--- /dev/null
+++ b/src/components/notifications/notifications.js
@@ -0,0 +1,16 @@
+import { sortBy, take } from 'lodash'
+
+const Notifications = {
+ data () {
+ return {
+ visibleNotificationCount: 20
+ }
+ },
+ computed: {
+ visibleNotifications () {
+ return take(sortBy(this.$store.state.statuses.notifications, ({action}) => -action.id), this.visibleNotificationCount)
+ }
+ }
+}
+
+export default Notifications