redux-persist icon indicating copy to clipboard operation
redux-persist copied to clipboard

Is there any way to split serialization via localforage?

Open rvision opened this issue 3 years ago • 0 comments

I am using localforage with IndexedDB and this works out of the box:

localforage.config({
	driver: [localforage.INDEXEDDB, localforage.LOCALSTORAGE],
	name: 'database'
});

however, my state will hold a lot of time series data in following shape:

slots: {
	'2021-01-01': {
		njTGdi: {
			start: 540,
			duration: 60,
			userId: 'gfnw8',
			notes: '',
		},
		cegw23: {
			start: 540,
			duration: 60,
			userId: 'gfnw8',
			notes: '',
		},
	},
	'2021-01-02': {
		Ujghti: {
			start: 540,
			duration: 60,
			userId: 'gfnw8',
			notes: '',
		},
		oiYHbg: {
			start: 540,
			duration: 60,
			userId: 'gfnw8',
			notes: '',
		},
	},
},

so this list will grow over time and I am afraid serialization won't be fast as needed.

Is there any way to segment this data? like, for example, to save each of the days as separate key/value pair? how to do that?

thanks

rvision avatar Jan 26 '22 17:01 rvision