I have two components that I'm reusing throughout my app, in other components and in different routes. For example: a "favorite this!" button that's visible at /patterns, at /patterns/:pattern_id (the pattern route), when viewing an individual project based on that pattern (at /projects/:project_id), when viewing the user's list of favorites (favorites), and in other places.
I'm starting to repeat code for these components' actions across different routes (pattern, patterns, favorites, etc.), which seems less than ideal / prone to errors.
I'd like to meet with someone for a few minutes to a) double check my understanding of how actions work / are connected across components and routes; and b) see if there's a way to reduce some of the repetition I'm experiencing.
I have two components that I'm reusing throughout my app, in other components and in different routes. For example: a "favorite this!" button that's visible at
/patterns, at/patterns/:pattern_id(thepatternroute), when viewing an individual project based on that pattern (at/projects/:project_id), when viewing the user's list of favorites (favorites), and in other places.I'm starting to repeat code for these components' actions across different routes (
pattern,patterns,favorites, etc.), which seems less than ideal / prone to errors.I'd like to meet with someone for a few minutes to a) double check my understanding of how actions work / are connected across components and routes; and b) see if there's a way to reduce some of the repetition I'm experiencing.