not-redux

1.0.1 • Public • Published

Demo at https://stackblitz.com/edit/react-frbq56

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'
})

Readme

Keywords

none

Package Sidebar

Install

npm i not-redux

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.43 kB

Total Files

6

Last publish

Collaborators

  • dolchi21