Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
realar
Advanced tools
Readme
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.
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>
))
npm install realar
# or
yarn add realar
Enjoy and happy coding!
FAQs
Advanced state manager for React
The npm package realar receives a total of 4 weekly downloads. As such, realar popularity was classified as not popular.
We found that realar demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.