- Able to listen to hash changes
- Have history api implemented
- Should be simple to use
Now i marked history api as important because in one page app you can't expect the users to forget about the back button. It is always going to be there and you should be prepared for that. Anyway the fist task is the git repo and here is the link to the same.
Now after initializing the repo i need a couple of calls to get the hash state after the page has loaded completely. Well the good news is that now i can call functions easily based on url although i will have to say that it was a little difficult because of the hash change listener. Which i was using by directly implementing window.onhashchange which did not give me access to the this object in the js and because of which i was not getting the url map on change of url hash but that was taken care of as could be seen in the router constructor function. Well i am leaving the history api from the first version will come back to it in a couple of days as i am really bored of working on two continuous js projects , me being a backend developer want to get into some of that stuff. But again to make a release on this library i need to add some essentials that can be used to make post request and get request to the server so here they come.Although i am going to write a simple XHR wrapper for it, nothing fancy there just to keep things simple and finish off this project so i can get a move on to others. Well the xhr interface is finished time for me to publish this library and move to something in backend. I am thinking in the lines of an interface library for mysql in c++ . The current implementation is well, too old , I think it needs something out of the box. So here i come my next project. Hope you like this one and do remember to post bugs on git so i can resolve them. After all there is only so much i can code without the codes being tested. And PS let the history api sit in a grave for now, I will come to it later but definitely not today.