codehood-org / mentors-website

Codehood Mentors Website
https://mentors.codehood.org
MIT License
6 stars 5 forks source link

Use localStorage to save hearted mentors. Solves #10 #32

Closed maccyber closed 4 years ago

maccyber commented 4 years ago

This PR creates a custom hook that keeps track of hearted mentors. Hearted mentors will be saved to localStorage and restored to state on page refresh.

I also added an id key to mentors.json.

islamCodehood commented 4 years ago

Thank you for the PR, @maccyber I will review it asap

islamCodehood commented 4 years ago

I would like to ask you for an explanation of this snippet, @maccyber

value instanceof Function ? value(storedValue) : value;

In which cases value value be an instance of Function?