JavaScript: Module architecture suggestions -


i wanna create website have left side search filter option panel, sort through data on website.

i thinking using revealing module pattern.

but should create module each filter options have there own filter logic -and create init module render selected filters?

what best module architecture in situation ? ?

thanks in advance.

no need use modules that. keep simple.

just use simple functions implement same "interface" (though there no concept of "interface" in js unless use typescript or similar language).

you can use library such lodash give lot tools define such kinds of functions , manipulate , compose them.

that implementation of filter functions though. application bit more complex that, may want check out how structure code of application if new you. mvc pattern start, bigger applications there other architectures may more suitable , want use framework react/redux or angular implement them properly.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -