mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-17 13:14:54 +00:00
markRead and markeUnread abstraction
This commit is contained in:
@@ -12,16 +12,13 @@ export const useEmailSelection = function(){
|
||||
this.emails.add(id);
|
||||
}
|
||||
},
|
||||
markRead(){
|
||||
forSelected(fn){
|
||||
this.emails.forEach(email => {
|
||||
email.read = true
|
||||
fn(email)
|
||||
})
|
||||
},
|
||||
markUnread(){
|
||||
this.emails.forEach(email => {
|
||||
email.read = false
|
||||
})
|
||||
}
|
||||
markRead(){ this.forSelected(e => e.read = true )},
|
||||
markUnread(){ this.forSelected(e => e.read = false )},
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user