E
E
Eugene2022-01-22 14:43:05
Google Chrome
Eugene, 2022-01-22 14:43:05

How to store application state?

Good afternoon, I want to write a browser extension, and I can’t figure out how to make a convenient data storage structure....
1. Do I understand correctly that I need to work with the page from one place (I think it’s optimal in the worker)? Send events to change - the worker changes the store, and the popup and content subscribe to the state change and react to them ... ala flux))
2. What is the best way to organize the storage structure? I want to somehow sharpen everything under one method ... but I have little design experience ... maybe there are some materials on the correct application architecture? I can’t find it ... it’s much more convenient to add on good architecture than to sculpt crutches ...

Z.s. I noticed that the popup does not respond to a change in state until you open it, so I send an event from the worker, can it be better to use the worker for both saving and retrieving data?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question