Coder Social home page Coder Social logo

baredux's People

Contributors

davidbruant avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

ynote

baredux's Issues

Typo in Readme

 increaseCount2(state){
            return {
                count = state.count + 1
            }
        }

it should be count: state.count + 1, right ?

Improve basic usage example

(based on feedback from @davidbgk )

const store = new Store({
    state: {
        count: 0
    }, 
    mutations: {
        increase(state, supplement){
            state.count += supplement
        }
    }
})

const {state, mutations, subscribe} = store;

console.log(state.count) // 0

mutations.increase(2)

subscribe(state => {
    console.log(state.count) // 2
})

count is 2 right after the call to increase, so the subscribe isn't really useful

Have a solution for "container components"

container components are components that are arbitrarily deep in the component tree but have a direct access to the store without the store being passed as props (they use a context so any component can access the store and container components transform the store into props with mapStateToProps)

Right now, baredux has no explicit support for container components, but i consider them a meaningful use case

To begin with, let's write an example of what it would take to write a container component with a React Context manually
If that's annoying to do by hand, let's provide a helper in the library

consider changing name

Unless Google Search results quickly change to something about this library, this is going to become embarassing :-/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.