Skip to content

dolchi21/not-redux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo at https://stackblitz.com/edit/not-redux

Install

npm install not-redux

HowTo

import { createStore, connect } from 'not-redux'

var person = createStore() // create a data store

// connect component to store
var PersonFullName = connect(person, state => {
    var name = [
        state.firstName,
        state.lastName
    ].join(' ')
    return { name }
})(props => <span>{props.name}</span>)

ReactDOM.render(<PersonFullName/>, rootElement)

// set store firstName to Dan
person.set('firstName', 'Dan')
// set store lastName as object
person.set({
    lastName: 'Abramov'
})

About

Simple React state management.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published