Skip to content

Commit

Permalink
#79 [Feat] 유저 위치 업데이트 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
soletree committed Aug 15, 2024
1 parent 6ddeef1 commit 2d628d0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Score/Score/Source/Reducer/Record/MapFeature.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// MapFeature.swift
// Score
//
// Created by sole on 8/16/24.
//

import CoreLocation
import ComposableArchitecture
import NMapsMap

@Reducer
struct MapFeature {
struct State: Equatable {
var locations: [NMGLatLng] = []
}

enum Action {
case updatingLocations(locations: [CLLocation])
}



var body: some ReducerOf<Self> {
Reduce { state, action in
switch action {
case .updatingLocations(let locations):
state.locations += locations.map{ .init(lat: $0.coordinate.latitude, lng: $0.coordinate.longitude)}
return .none
}
}
}
}

0 comments on commit 2d628d0

Please sign in to comment.