fac19 / Week8-BFOP

https://snippetsofcode.herokuapp.com/
0 stars 2 forks source link

Delete listener in router #40

Closed oliverjam closed 4 years ago

oliverjam commented 4 years ago

https://github.com/fac19/Week8-BFOP/blob/de596ab49f66d14e1b05a2a35165f07f4671e560/public/router.js#L41-L51

This is very application-specific logic, so I'm not sure it makes sense in the router.

Is there any reason you can't add click handlers to the buttons when you render them here?

https://github.com/fac19/Week8-BFOP/blob/de596ab49f66d14e1b05a2a35165f07f4671e560/public/routes/home.js#L73-L79

You could even skip the data-id attribute then since you have access to the relevant IDs within the scope of that function.