K
K
Konstantin2020-10-24 18:08:04
JavaScript
Konstantin, 2020-10-24 18:08:04

Where to store search settings?

The method requests data from the server, the server returns a JSON object with data on the previously performed search, search parameters.

There can be multiple lookups in a project, in different sections, so the JSON is:

l

et res = {"search1": {...parameters}, "search2": {...parameters}}


The question is, how and where to store these settings so that you can retrieve search parameters and set them?

Is it worth creating a structure class Search {}, class Search1 extends Search {}where to store the data? Suppose so, then where to store the Search objects? To make it easy to work with them, wrap them in a facade?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2020-10-24
@Junart1

It's easier - put it in data-src in the search field.
searchField.setAttribute('data-src', res);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question