feathersjs-ecosystem / feathers-localstorage

A client side service based on feathers-memory that persists to LocalStorage
MIT License
38 stars 15 forks source link

Allow parse and stringify extension #120

Open DaddyWarbucks opened 1 year ago

DaddyWarbucks commented 1 year ago

I would like to see two methods added to this class parse(string) and stringify(data). And those methods should just return their JSON method by default and should be used to parse/stringify the store. The following two places would be updated to use this.parse or this.stringify

This would allow the user to extend the service class and use their own parser. My specific example for this is using JSON Compression to compress the store before storing it in storage and decompress the store when pulling it out of storage.