P
P
polak2282021-11-03 12:05:00
AJAX
polak228, 2021-11-03 12:05:00

SPA in native JS?

I want to create a pure JS SPA application. At first, everything is fine:
1) the router, depending on the configuration of the routes, dynamically inserts html into the mounted element, without reloading the pages;
2) binder creates custom events with specific details;
3) the listener catches them and gives the details to the models.

But then difficulties begin:
1) title is static. It is written in the routes configuration, but if the user is logged in, then you need to substitute the login for the title, for example: profile | login;
2) an unauthorized user should not have access to the account pages;
3) pages have dynamic parts: user login, number of subscribers/friends, etc.

Link to the project:https://github.com/polak228/Kverlit
What is the best way to implement SPA in native JS? Do you have examples of real projects?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Erzhovich, 2021-11-03
@polak228

Try SVELTE , everything has already been invented there, it turns out native JS without a framework.
Otherwise, you will write your own framework)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question