Multiparadigm state manager for React by ~2 kB.

betula

Slava Birch

Posted on February 4, 2021

Multiparadigm state manager for React by ~2 kB.

Realar multiparadigm state manager for React based on reactive mathematic.

Light, Fast, and Pretty looked 😘

Targeted to clean code, modulable architecture, and time of delivery user experience.

Supported two kinds of data and logic definitions.

  • Plain functional reactive programming with only functions
const [getCount, set] = box(0);

const tick = () => set(getCount() + 1);
setInterval(tick, 200);

const App = () => {
  const count = useValue(getCount);
  return (
    <p>{count}</p>
  )
}
Enter fullscreen mode Exit fullscreen mode

Try on CodeSandbox

  • And transparent functional reactive programming with classes, decorators and jsx wrapper
class Ticker {
  @prop count = 0
  tick = () => ++this.count;
}

const ticker = new Ticker();
setInterval(ticker.tick, 200);

const App = () => (
  <p>{ticker.count}</p>
)
Enter fullscreen mode Exit fullscreen mode

Try wrapped version on CodeSandbox

Realar targeted to all scale applications up to complex enterprise solutions on microfrontends architecture.

You can use as many from Realar as you want. For small websites or theme switchers, two functions are enoughπŸ‘Œ Step by step on applications scale stairs you can take more and more. From sharing state to all application parts, to modulable architecture with apps composition.

I made my choice!

πŸ’– πŸ’ͺ πŸ™… 🚩
betula
Slava Birch

Posted on February 4, 2021

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related