
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
storeon-choo
Advanced tools
A tiny connector for Storeon and Choo.
Size is only 81 bytes (minified and gzipped). It uses Size Limit to control size.
Read more about Storeon article.
npm install -S storeon-choo
or
yarn add storeon-choo
Create store using storeon
module:
store.js
import { createStoreon } from 'storeon'
let counter = store => {
store.on('@init', () => ({ count: 0 }))
store.on('inc', ({ count }) => ({ count: count + 1 }))
}
export const store = createStoreon([counter])
index.js
Use storeonMiddleware
from storeon-choo
.
import choo from 'choo'
import storeonMiddleware from 'storeon-choo'
import { store } from './store'
const app = choo()
app.use(storeonMiddleware(store))
app.route('/', require('./views/main'))
module.exports = app.mount('body')
Emitting @dispatch
event with payload (like [event, data]
) you will dispatch storeon
event. All states are located in state.storeon
property.
main.js
import html from 'choo/html'
export default function view(state, emit) {
const increment = () => emit('@dispatch', ['inc'])
return html`
<body>
<h1>Count: ${state.storeon.count}</h1>
<button onclick=${increment}></button>
</body>
`
}
FAQs
A tiny (81 bytes) connector for Storeon and Choo
The npm package storeon-choo receives a total of 0 weekly downloads. As such, storeon-choo popularity was classified as not popular.
We found that storeon-choo 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.