From 33adba20ab145bbe3277085324f7343d11c2763a Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 9 Nov 2020 12:47:27 +0000 Subject: [PATCH] Fix build after SwiftFormat changes --- Sources/TokamakDOM/Storage/WebStorage.swift | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Sources/TokamakDOM/Storage/WebStorage.swift b/Sources/TokamakDOM/Storage/WebStorage.swift index 31e93dad..9d959ae7 100644 --- a/Sources/TokamakDOM/Storage/WebStorage.swift +++ b/Sources/TokamakDOM/Storage/WebStorage.swift @@ -29,50 +29,50 @@ protocol WebStorage { var publisher: ObservableObjectPublisher { get } } -public extension WebStorage { - internal func setItem(key: String, value: Value?) { +extension WebStorage { + func setItem(key: String, value: Value?) { publisher.send() if let value = value { _ = storage.setItem!(key, String(describing: value)) } } - internal func getItem(key: String, _ initialize: (String) -> Value?) -> Value? { + func getItem(key: String, _ initialize: (String) -> Value?) -> Value? { guard let value = storage.getItem!(key).string else { return nil } return initialize(value) } - func store(key: String, value: Bool?) { + public func store(key: String, value: Bool?) { setItem(key: key, value: value) } - func store(key: String, value: Int?) { + public func store(key: String, value: Int?) { setItem(key: key, value: value) } - func store(key: String, value: Double?) { + public func store(key: String, value: Double?) { setItem(key: key, value: value) } - func store(key: String, value: String?) { + public func store(key: String, value: String?) { setItem(key: key, value: value) } - func read(key: String) -> Bool? { + public func read(key: String) -> Bool? { getItem(key: key, Bool.init) } - func read(key: String) -> Int? { + public func read(key: String) -> Int? { getItem(key: key, Int.init) } - func read(key: String) -> Double? { + public func read(key: String) -> Double? { getItem(key: key, Double.init) } - func read(key: String) -> String? { + public func read(key: String) -> String? { getItem(key: key, String.init) } }