Skip to content

Commit

Permalink
Update demo version of Beedle
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy-set-studio committed Aug 2, 2018
1 parent 31d8554 commit 999cbbf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions demo/beedle.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,9 @@ export default class Store {
// Set the value as we would normally
state[key] = value;

// Trace out to the console. This will be grouped by the related action
console.log(`stateChange: ${key}: ${value}`);

// Publish the change event for the components that are listening
self.events.publish('stateChange', self.state);

// Give the user a little telling off if they set a value directly
if(self.status !== 'mutation') {
console.warn(`You should use a mutation to set ${key}`);
}

// Reset the status ready for the next operation
self.status = 'resting';

Expand Down Expand Up @@ -73,17 +65,11 @@ export default class Store {
return false;
}

// Create a console group which will contain the logs from our Proxy etc
console.groupCollapsed(`ACTION: ${actionKey}`);

// Let anything that's watching the status know that we're dispatching an action
self.status = 'action';

// Actually call the action and pass it the Store context and whatever payload was passed
self.actions[actionKey](self, payload);

// Close our console group to keep things nice and neat
console.groupEnd();

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "beedle",
"version": "0.3.1",
"version": "0.3.2",
"description": "Beedle is a tiny little 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 to both better control and cascade state across your application.",
"main": "dist/beedle.js",
"scripts": {
Expand Down

0 comments on commit 999cbbf

Please sign in to comment.