Sha256: a71ad824e72af1dfa4c5af627122ec9efd68b48522a78613933587dd36d5c948

Contents?: true

Size: 688 Bytes

Versions: 2

Compression:

Stored size: 688 Bytes

Contents

# redux.rb [![[version]](https://badge.fury.io/rb/redux.svg)](http://badge.fury.io/rb/redux)  [![[travis]](https://travis-ci.org/janlelis/redux.rb.png)](https://travis-ci.org/janlelis/redux.rb)

A [Redux](https://github.com/rackt/redux) implementation in Ruby.


## Setup

Add to your `Gemfile`:

```ruby
gem 'redux'
```


## Usage

```ruby
reducer = ->(state = 0, action){
  case action['type']
  when 'INCREMENT'
    state + 1
  when 'DECREMENT'
    state - 1
  else
    state
  end
}

store = Redux::Store.new(0, &reducer)
store.dispatch "type" => "INCREMENT"
store.state # => 1
```


## MIT License

Copyright (C) 2016 Jan Lelis <http://janlelis.com>. Released under the MIT license.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
redux-0.1.1 README.md
redux-0.1.0 README.md