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