Since data is not encapsulated inside React component tree, I found it to be multiple times faster than when using Context.
And one thing that's perhaps the most obvious... it's simpler because you don't have to use Providers at all.
What do you mean by data being encapsulated in the tree? How does that make it slower?
I tried scoping the entities using Context in some prior art which we use in production. Some colleagues kindly gave me some benchmark results and the version without Context (external/module-scope) was faster.
I'm not trying to debate against Context here. In fact, there's nothing that would stop anyone from using SimpleR State's entities with Context API.
It's never my intention for this library to try and be the "best" out there. I simply want to create what I sought for, which is the closest to the simplest approach I can think of. And to share it to the public, in case someone out there is looking for the same thing I am, and maybe it could help that someone. That's what open source is for, after all.
> multiple times faster than when using Context
Oh cool! Do you have some benchmark results for that? Would be awesome to post them in the README if you can.
> simpler because you don't have to use Providers at all
I think the Provider pattern is part of the functional programming pattern with React, so while I do agree it might be harder to get used to but it underlines the no side-effects affecting the state of a given React components and its children.
At scale proper action, reducer pattern is helpful to manage a complicated state tree to still make it functional, easily testable and giving the same end result as a function of state.