Posts

Showing posts with the label react-native

React Native: A classic event model approach for the Reducer

Image
Are you having a hard time understanding the Reducer hook? ** to be clear this is a blog non intended for beginners but for showing a different view for Reducers. As some may remember from college(those who studied CSC or computer related stuff) the classic event model uses 3 concepts: " Events ", " Handlers " and a " Monitor ". An event is a constant which describes(as detailed as possible) what happened. A handler is a function that gets the event as a parameter to execute what would happen after the event. The monitor is an arbitrator who chooses when the handlers show be executed according to the events. In other words, it is the one who controls the entire event system. Whit that in mind relating to the Reducer-dispatch model is just as simple as applying what you learned to code in Java(back in school) to ReactJs or any library, API, or framework that uses this Reducer concept.  Therefore, I decided to create my own interpretation of Reducer whenever...