dscheerens / ngx-webstorage-service

Module for Angular that provides service wrappers for the Web Storage API
MIT License
65 stars 11 forks source link

Possibly broken `withDefaultTranscoder` example in `README.md` #54

Open akaustav opened 1 year ago

akaustav commented 1 year ago

Problem Description

In the README.md file, under the "Storage transcoders" section, the example code for withDefaultTranscoder function is possibly broken because of two problems:

  1. Missing this keyword: Cannot find name 'numberStorage'. Did you mean the instance member 'this.numberStorage'? ts(2663)
  2. Returned value from a setter: Setters cannot return a value. ts(2408)

Current Code

...
return numberStorage.get('answer');
...
return numberStorage.set('answer', value);
...

Expected Code

...
return this.numberStorage.get('answer');
...
this.numberStorage.set('answer', value);
...