Supports Functional Programming Concepts
As noted earlier, design of Redux takes influence from the functional programming language –Elm. It supports some of the widely used functional programming concepts – treat functions as first class objects, chain functions together, pass functions as arguments, and support user functions. The functional programming concepts help developers to write clean and modular code by creating smaller functions. The smaller functions enhance code reusability, along with accelerating web application testing, debugging, and maintenance.
Can be Used like Flux
Has Three Key Building Blocks
Store is designed as an object to hold the application state. The helper methods provided by store enable developers to access application state, register listeners, and dispatch actions. Reducer, on the other hand, is a collection of functions that decide how to change application state based on the data sent through action. It takes an action as an argument and then returns a new state. Hence, reducer is primary responsible for changing application state.
Uses Pure Functions Extensively
As Redux supports functional programming concepts, it becomes easier for developers to keep the code base concise, maintainable, and reusable by writing small functions. They even have option to keep the scope and logic in individual functions isolated. The programmers can also use a variety of functions – pure functions, anonymous functions, higher-order functions and closures. At the same time, Redux uses pure functions extensively. The pure functions return new values based on the argument passed to them without modifying the existing objects or values. They return new objects based on passed arguments regardless of the state. Hence, the pure functions become more predictable than other functions. While using Redux, a programmer can leverage pure functions to return the desired values without modifying the existing object and values.
Compatible with a Variety of View Libraries
Simplifies Complex Web Application Development
Has Its Own Shortcomings