Skip to content
Eliseo Geraldo edited this page May 23, 2019 · 6 revisions

Wallant provides persistant, auto-validate, and predictable state container for React Native, it can be slower than Redux or React Context, we sacrificed speed for store maintainability. The main advantages of wallant are in it's easy of use, and its ability to disconnect and reconnect from any component, integrating wallant in an existing project is much easier than integrating Redux or Context, getting rid of Wallant is also easy, due to that connects with the main components without modifying the or insert props, all the data exist outside the components, and are consumed directly from the store.


Learn about...

All context from store, connect, consume and hooks.


About data, how mutate, and how consume


Dispatch actions in store


πŸ’Ύ persistant (soon...)

Data storage it's easy with Wallant


πŸ›  computed (soon...)

Take state data and expose as new data in the same state


πŸ‘Œ validate (soon...)

Break bad states, and avoid useless renders


πŸ™Œ modularize (soon...)

Design pattern recomended for big stores


Quick start

/* store.js */

import Wallant from 'wallant'

const store = new Wallant({
  state: {
    count: 0
  },
  actions: {
    increment () {
      // ss === setState => true
      this.ss({
        count: count++
      })
    }
  }
})

export default store
/* App.js */

// import React and React Native and stuffs
import store from './store'

class App extends Component {
  componentDidMount () {
    /*
    * Store takes component instance
    * and can update when store change
    */
    store.use(this)
  }
  render () {
    <View>

      <Text>Number is { store.state.count }</Text>

      <Button
        title="increment counter"
        onPress={ store.action.increment }/>

    </View>
  }
}

// styles, exports, and stuffs