feathersjs-ecosystem / feathers-localstorage

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

Use app.configure() to set storage type from client #78

Closed soulofmischief closed 5 years ago

soulofmischief commented 6 years ago

I have some hooks defined on a service that I don't wish to reimplement in the client when using feathers-localstorage.

I would like to define the services on the server, using a flag to decide whether to use the localstorage DB or another DB, and configure the localstorage on the client to use these services but save data locally in the browser.

I would like to do this without importing server hooks into the client during the build. Using app.configure() seems to be the simplest way, similar to how feathers-authentication does it:

import feathers from '@feathersjs/client'

export const app = feathers()
  .configure( feathers.authentication({
    storage: localStorage,
  }))
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Apologies if the issue could not be resolved. FeathersJS ecosystem modules are community maintained so there may be a chance that there isn't anybody available to address the issue at the moment. For other ways to get help see here.