ember-inspector icon indicating copy to clipboard operation
ember-inspector copied to clipboard

Ability to persist properties in services via inspector

Open gokatz opened this issue 5 years ago • 5 comments

It would be great if we can persist the service properties in inspector even after a reload (maybe via localStorage). This will save a lot of time in the development phase.

gokatz avatar May 28 '19 14:05 gokatz

@gokatz I am not sure I understand. What is the use case here?

RobbieTheWagner avatar May 28 '19 14:05 RobbieTheWagner

Sorry for leaving less information.

My specific use case is that, let's say, I'm using a property called isAdminUser from users service (or maybe from a controller) in a template and based on this, I show a specific section in the top bar. In the development process, I would need to set this property to true and false and test the possible UI states. I can do this using the inspector with the help of the instance export ($E). But I have to do this on every change reload (i.e on every file change) because the modified state will not be persisted.

It would be great if I could store the value of isAdminUser in browser storage and the inspector will modify the isAdminUser property (of service or any such object instance) on every app boot if an override is present in the browser storage. So, that I might not need to modify them manually on every reload.

This would also be cool when we show a POC to a co-worker/manager and states can be persisted across reloads. Hope this clarifies the actual issue. Please get back if you need anything else.

gokatz avatar May 28 '19 17:05 gokatz

@gokatz I understand now. Why not set isAdminUser: true in your app until you are done testing?

RobbieTheWagner avatar May 28 '19 18:05 RobbieTheWagner

Yeah, I can and it cost a building step whenever I switch between them. It will be tough if the project is huge and rebuilding takes a considerable amount of time. There are two cases where it's hard to do that:

  1. In case of demonstrating them, it will easy to switch between them to showcase.
  2. In case of playing around someone's staging changes, I may not be able to control their code.

gokatz avatar May 29 '19 04:05 gokatz

I'm doing some issue gardening 🌱🌿 🌷 and came upon this issue. Since it's quite old I just wanted to ask if this is still relevant? If it isn't, maybe we can close this issue?

By closing some old issues we reduce the list of open issues to a more manageable set.

sandstrom avatar Nov 02 '21 09:11 sandstrom