mkozhukharenko / ums-frontend

ums-frontend
MIT License
1 stars 1 forks source link

Save/get dictionary data to/from local storage #8

Closed mkozhukharenko closed 8 years ago

mkozhukharenko commented 8 years ago

To reduce amount of HTTP request some data can be save to local storage.

This side effect should take place in middleware

Retrieve (get)

Here two options:

  1. Retrieve saved data in middleware before FETCH (and if data is available - don't make a request) OR
  2. Fill store with data on application bootstrap. In this case an initialState that is passing down to sore (then it's creating) should be filled with data.

More detailed description:

Dictionaries

All dictionaries must be save to localstorage (for now there only of of them - see src/modules/dictionaries/constants.js) Time to save - e.g. 2 week.

There should not be an HTTP request if data was already loaded.

should be save to cookie

Timeperiod id

should be save to cookie