Add getStore function

I think using getStore function is better than duplicating `type === 'local' ? localStorage : sessionStorage` all the time.