☄️ Why do you need Effector?
Effector is reactive state manager. It is decentralized, declarative and efficienct.
Effector was created to manage data in complex applications without danger of inflating a monolithic central store. It provides events/effects and reactive storages. It has explicit control flow, Flow and TypeScript type definitions and sufficient API
Here are some principles:
-
application store should be as light as possible - you should not be frightened by the idea that you need to add another store for specific needs
-
stores should be freely combined - the idea is that the data that the application will need can be distributed statically by showing in advance how the data will be transformed during the operation of the application
-
it should by design eliminate the need for "reselect", notifying about changes only those who need them. This allows you to not worry about the fact that you will have the entire application triggered if you want to exctact the state of modalwindow from React. Concurrently, this means that applications are spared from the problems with performance such as "react-redux" encountered when switching to context
-
give opportunity, place, and way to remove any desired business logic from the view, making the components as simple as possible
-
independence from controversial concepts - no decorators, no dependencies from reactr/ rxjs, the need to use classes or proxies - none of this is required to manage the state of the application and therefore the api library uses only functions and plain js objects
-
predictabile API: a small number of basic principles are reused in various cases, reducing the burden on the user and increasing awareness. Knowing how .watch works in events, you can guess what the .watch function does in front of it.
-
the application is easily built from a combination of basic elements and the ability to build new ones
-
there is no point in trying to pass everything off for streaming, for reducer or observable. Effector offers a solution to manage the data structure rather than hide it
-
the most efficient way to manage state reliably is to describe the interaction of the data declaratively and provide all the dirty work to the automation