2

I am building a JavaScript application that makes AJAX requests to a PHP API Back-end to load JSON data for different views.

The app UI consist mainly of a left sidebar menu which has items loaded that when clicked on will create a View for a Right content panel. Like this image...

enter image description here


The left sidebar will have up to 60 items which all will be responsible for loading any 3rd party libraries that the item needs on its right content panel as well as initiating any DOM event needed for that view and loading any JSON data from the remote API server.


QUESTIONS

My main question is when a left sidebar item builds the right content panel UI for an item and then later that same item is clicked again which would build it again. How can I go about making sure the whole app doesn't end up having all the items libraries and JSON data and other data built which would bog down the apps memory usage?

I do not want to use a library like BackboneJS or AngularJS. Just pure JS is my goal with exception of 3rd party libraries that tyhe sidebar items/modules will need.

Any tips appreciated I have been researching for a while now without much luck in finding information on this!

3
  • Why no libraries? You seem to be okay with them in some sense if you're willing to load them in for each item in the menu. What's the deal? Commented Mar 16, 2017 at 2:02
  • @1252748 If I found the right lib that I liked then I might but I don't want something like Backbone or AngularJS Commented Mar 16, 2017 at 3:46
  • Please be more specific about what you find unattractive about those libraries. Definitely will help to formulate an answer. Commented Mar 16, 2017 at 4:33

1 Answer 1

1

The same way the libraries do. Maintain state in memory and check that state when performing actions.

With local storage and other advantages of modern browsers theres no real difference between a SPA and a win form (for example) application

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.