Code Monkey home page Code Monkey logo

reduxstore's Introduction

ReduxSwift

Medium Blog

This repo implements Redux architecture in Swift to enable RxSwift and Combine based applications to leverage unidirectional data flow.

Why

Redux talks about a single source of truth for state managment to avoid to many floating variable and boolean flags in various view model and view controllers.

Components

  • State
  • Action
  • ActionHandler
  • Reducer

State

A state where all computation for a state mutation takes place. State type encapsulate all the feature and app wide state values.

Action

Action encapsulates all the events that can happen in the feature or app. For example, a screen can have a button and a label and button tap event is an action.


enum Action {
    case buttonTap
}

ActionHandler

ActionHandler encapsulates the implemenation details for Action type. ActionHandler type takes care of making all the async calls for your feature.

Reducer

The Reducer plays a pivotal role in updating the state and triggering any side effects following a state mutation. It is accessible via the store and exclusively manages the state's evolution. The store, in turn, handles the task of informing listeners about state changes and side effect alterations. Side effects, in the context of feature or app development, encompass anything capable of influencing a shift in the overall user experience.

SideEffects

Side effects, as the name implies, are outcomes or effects resulting from various actions. These effects can be triggered by different factors such as user interactions, asynchronous calls, or other events. Unlike a simple action, which typically represents an intent or change in the application state, a side effect refers to the broader consequences or results that occur due to an action, often extending beyond the immediate state change.

reduxstore's People

Contributors

singh88 avatar

Watchers

 avatar

reduxstore's Issues

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.