Gathering detailed insights and metrics for beedle
Gathering detailed insights and metrics for beedle
Gathering detailed insights and metrics for beedle
Gathering detailed insights and metrics for beedle
A tiny library inspired by Redux & Vuex to help you manage state in your JavaScript apps
npm install beedle
Typescript
Module System
Node Version
NPM Version
Add basic test suite
Updated on Aug 05, 2018
Refactor Pub/Sub and remove Webpack
Updated on Aug 05, 2018
Change how default state is set
Updated on Aug 03, 2018
Fix webpack bundling
Updated on Aug 03, 2018
Create demo and trim out logs
Updated on Aug 02, 2018
Implement Babel
Updated on Aug 02, 2018
JavaScript (99.79%)
Vue (0.2%)
HTML (0.01%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
390 Stars
114 Commits
37 Forks
3 Watchers
39 Branches
5 Contributors
Updated on May 28, 2025
Latest Version
0.8.1
Package Id
beedle@0.8.1
Size
1.29 MB
NPM Version
6.4.1
Node Version
10.15.0
Published on
Jun 18, 2019
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Beedle is a tiny library to help you manage state across your application. Inspired by great libraries like Vuex and Redux, Beedle creates a central store that enables you predictably control and cascade state across your application.
This library was initially created as a prototype for this article on CSS-Tricks, where you learn how to build a state management system from scratch with Vanilla JavaScript.
See the documentation — See the project structure
Beedle creates a pattern where a single source of truth, the 'Application State' cascades state across your app in a predictable fashion. To modify state, a set flow of actions
and mutations
help create a traceable data-flow that makes things a little easier to debug.
Using a Pub/Sub pattern which notifies anything that is subscribed to changes, a fully reactive front-end can be achieved with a few kilobytes of vanilla JavaScript.
As the diagram above shows, a simple, predictable flow is created by pushing data into an action
which subsequently calls one or more mutations
. Only the mutation
can modify state, which helps with keeping track of changes.
Continue reading the documentation
Beedle is inspired by libraries like Redux, but certainly isn't designed to replace it. Beedle is aimed more at tiny little applications or where a development team might be looking to create the smallest possible footprint with their JavaScript.
Beedle is intended to be tiny, so the largest that the uncompressed size will ever get to is 5kb.
Beedle is aimed at browsers that support ES6 by default. It also uses a Proxy to monitor state, so anything that supports Proxy will support Beedle.
You could use the Proxy polyfill to support more browsers.
Most major browsers will support Beedle with no issues.
You can pull Beedle down via npm or take a zip of this repository. The rest of this guide assumes you've used npm.
Run npm install beedle
in your project directory.
store
instanceFirst up, import it into your JavaScript:
1import Store from 'beedle';
Once you've got that you should create some actions
, mutations
and some initial state:
1const actions = { 2 saySomething(context, payload) { 3 context.commit('setMessage', payload); 4 } 5}; 6 7const mutations = { 8 setMessage(state, payload) { 9 state.message = payload; 10 11 return state; 12 } 13}; 14 15const initialState = { 16 message: 'Hello, world' 17};
Once you've got those setup, you can create a Store
instance like this:
1const storeInstance = new Store({ 2 actions, 3 mutations, 4 initialState 5});
Let's say you've got a text box that you type a message into. When the content is changed, it could dispatch a new message to your store:
1 2// Grab the textarea and dispatch the action on 'input' 3const textElement = document.querySelector('textarea'); 4 5textElement.addEventListener('input', () => { 6 7 // Dispatch the action, which will subsequently pass this message to the mutation 8 // which in turn, updates the store's state 9 storeInstance.dispatch('saySomething', textElement.value.trim()); 10});
Beedle uses the Pub/Sub pattern to transmit changes. Let's attach the message to a DOM element:
1// Grab the text element and attach it to the stateChange event 2const messageElement = document.querySelector('.js-message-element'); 3 4// This fires every time the state updates 5storeInstance.subscribe(state => { 6 messageElement.innerText = state.message; 7});
Head over to the basic demo to see this in action ????
Thanks to Eli Fitch for giving me the idea to call this Beedle. This matches my preference to call my little projects names based on Zelda. Here's Beedle from Zelda.
Thanks to the incredible people who maintain projects such as Redux, Vuex and MobX et. al. Thanks for making our lives easier and for inspiring this project.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 9/19 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
148 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More