Giter Club home page Giter Club logo

redux-twitter's Introduction

Hi there 👋

I'm an iOS Developer working in Barcelona, Spain, and originally from Istanbul, Turkey.

Linkedin Badge Medium Badge


📕 Latest Articles

➡️ more articles...

redux-twitter's People

Contributors

goktug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

redux-twitter's Issues

Always showing the same post items

Hello,

I don't know where I am doing wrong at. The problem is that there is a timeline, showing all posts from users a user following, and a profile view, which needs to show only the current user's post. But it also shows the posts of the following users.

Should I make a separate reducer as well as action and state? The following is my current reducer.

enum PostsReducer {
    static var reducer: Reducer<PostsState> {
        return { action, state in
 
            guard let action = action as? PostsAction else {
                return state ?? PostsState()
            }
            var newState = state
            
            switch action {
            case let .updatePosts(userID, posts):
                newState?.userPosts[userID] = posts
                return newState!
            case let .updateListener(userID, listener):
                newState?.postsListeners?[userID] = listener
                return newState!
            case let .updateUserPosts(posts):
                newState?.posts = posts
                return newState!
            case let .updateUserListener(listener):
                newState?.userPostsListener = listener
                return newState!
            }
        }
    }
}

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.