Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

booga

Manage redux state with sugar js

WebApp that sums and subs numbers from an state

import Store from 'booga';
import { Component } from 'react';

let store = Store({
    storage: Store.localStorage('TESTING_LOCALSTORAGE'),
    initial: {
        count: 10
    }
});

store.count = (c) => c < 0? 0 : c;

export default class Testing extends Component {

    constructor (props) {
        super(props);

        this.state = store(this, {
            count: 'count'
        });
    }

    render () {
        return (
            <div>
                <h1>{ this.state.count }</h1>
                <button onClick={ () => store.count++ }>+</button>
                <button onClick={ () => store.count-- }>-</button>
            </div>
        );
    }
    
}

About

Manage redux state with sugar js

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages