A lot have changed since my latest post 4 years ago, frameworks like ReactJS, Angular and VueJS rised to be known by everyone, and along with it, libraries like Redux and RxJS have shown not to be only good but also required in almost every projects. Almost every week there is something new that we have to know.
But what made me write this post was the new React Context API that just appeared in React v16.3.
Some say that this new API has almost killed Redux in ReactJS applications, and the future will say if that’s true 🙂
Because of this i’ve created a new library to work with this new API but i’ve given it a little taste of the Redux style we are used to.
The idea behind recost is to give the possibility to the developer to handle the state changes just like we did it on Redux, by dispatching actions and handle the changes on reducers.
Also, it gives the possibility by exporting the dispatch function out of the Provider scope to inject data into the context of the Provider. This is useful if you have a component that is self contained in it’s own provider, and you want to give the possibility for an outer component to insert data into it’s context, like a list of notifications for example.
You can check the entire source code on Github along with an example and a full explanation of the library.
Hope you like it, and if you have any request or suggestion just leave a comment down bellow oropen an issue on Github 🙂
I’ve made a little code snippet to handle the window.onload event the right way, and thanks to some feedback, people said that it would be even better if it could handle the DOMContentLoaded event. Read More »
I’ve been developing a plugin called SocialShare, the objective is to create sharing buttons to all the Social Networks, but i don’t want to use any framework to achieve this goal. And, because of that, i’ve encountered a small step back. The window.onload doesn’t really work has i intended. So, i’ve made my own onload event handler.