npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

realar

v0.6.8

Published

Advanced state manager for React

Downloads

32

Readme

Realar

npm version npm bundle size code coverage typescript supported

The state manager to reduce developers' coding time and increase the lifetime of your codebase.

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

  • Logic free React components. Perfect instruments for moving all component logic outside. Your React component will be clean from any unnecessary code, only view, only JSX, no more.
  • Lightweight and Fast. Less then 5kB. Aims at the smallest size of the resulting bundle. And only parts are updated in which is really necessary to make changes.
  • Value and Signal is the big elephants remind Store and Action from Redux. Allows you to perform familiar coding techniques, and also add many modern features.
  • Declarative and Imperative both supported.
  • Stream event and value programming.
  • Modular Architecture. Possibilities for the implementation of three levels of logic availability. Shared stateful is available for any part of your app. Scoped logic decomposition for React component context visibility. And React component local logic.
  • Decorators for classes lovers. Support OOP as one of the primary syntaxes. The implementation of transparent functional reactive programming (TFRP) with React (looks similar to Mobx). And the babel plugin for automatic wrap all arrow JSX functions for the best clean code.

Usage

You can make stores and "actions" play on runkit

const store = value(0)

const add = store.updater((state, num) => state + num)
const inc = store.updater(state => state + 1)

And bind to React easily play on codesandbox

const App = () => {
  const state = useValue(store)

  return <p>{state}
    <button onClick={inc}>+</button>
  </p>
}

You can make streams play on runkit

const addendum = value('0').pre(ev => ev.target.value)
const sum = signal()
  .map(() => +addendum.val)
  .filter()
  .to(add)

And bind to React play on codesandbox

const App = () => {
  const addendumState = useValue(addendum)

  return <p>
    <input value={addendumState} onChange={addendum} />
    <button onClick={sum}>sum</button>
  </p>
}

You can use classes with decorators

class Counter {
  @prop state = 0

  add = (num) => this.state += num
  inc = () => this.add(1)
}

And bind to React play on codesandbox

const App = observe(() => {
  const { state, inc } = useLocal(Counter)

  return <p>{state}
    <button onClick={inc}>+</button>
  </p>
})

And you can use it together play on codesandbox

const counter = new Counter()

const store = value.from(() => counter.state)

export const App = observe(() => (
  <p>
    {store.val}
    <button onClick={counter.inc}>+</button>
  </p>
))

Documentation

Demos

  • Hello - shared state demonstration.
  • Todos - todomvc implementation.
  • Jest - unit test example.

In Production

Articles

Installation

npm install realar
# or
yarn add realar

Enjoy and happy coding!