diff --git a/Score/Score/Source/Reducer/Record/MapFeature.swift b/Score/Score/Source/Reducer/Record/MapFeature.swift new file mode 100644 index 0000000..1d25e92 --- /dev/null +++ b/Score/Score/Source/Reducer/Record/MapFeature.swift @@ -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 { + 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 + } + } + } +}