1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00
persephone/Persephone/State/Reducers/ArtistReducer.swift

26 lines
467 B
Swift

//
// ArtistReducer.swift
// Persephone
//
// Created by Daniel Barber on 2019/9/29.
// Copyright © 2019 Dan Barber. All rights reserved.
//
import ReSwift
func artistListReducer(action: Action, state: ArtistListState?) -> ArtistListState {
var state = state ?? ArtistListState()
switch action {
case let action as UpdateArtistListAction:
state.artists = action.artists.map { Artist(name: $0) }
default:
break
}
return state
}