This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": { | |
"en": "English", | |
"es": "Spanish" | |
}, | |
"description": "Description" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run fastlane | |
# pass 'patch', 'minor' or 'major' as parameter | |
fastlane ios beta bump:patch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Deploy a new version to the Fabric." | |
lane :fabric do | |
# upload to Beta by Crashlytics | |
crashlytics( | |
api_token: ENV['FABRIC_API_TOKEN'], | |
build_secret: ENV['FABRIC_BUILD_SECRET'] | |
) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export FABRIC_API_TOKEN=1111 | |
export FABRIC_BUILD_SECRET=x1x1x1x1x1 | |
export GITHUB_TOKEN=11xx1x1x1x1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This middleware executes the async requests related with the Rest API | |
internal val networkMiddleware: Middleware<AppState> = { dispatch, state -> | |
{ next -> | |
{ action -> | |
when (action) { | |
// an async operation is called | |
is SetDeviceInfo -> { getDeviceDescription(deviceId = action.deviceId, | |
deviceInfo = action.payload, | |
dispatch = dispatch) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class DeliveryState: StateType { | |
object NotStarted: DeliveryState() | |
data class SettingUp (val appId: AppId, | |
val serviceId: ServiceId, | |
val description: ServiceDescription? = null): DeliveryState() | |
data class Going (val progress: DeliveryProgress): DeliveryState() | |
data class IsIdle (val reason: Idle): DeliveryState() | |
data class Failed (val error: Throwable): DeliveryState() | |
data class Finished (val status: ServiceStatus): DeliveryState() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum DeliveryState: StateType { | |
case notStarted | |
case settingUp(appId: AppId, | |
serviceId: ServiceId, | |
description: ServiceDescription? = null) | |
case going(progres: DeliveryProgress) | |
case idle(reason: Idle) | |
case failed(error: Error) | |
case finished(status: ServiceStatus) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed class Result <out V, out E> { | |
// Idle state | |
object Loading : Result<Nothing, Nothing>() | |
// Operation finished correctly with result saved on value | |
data class Ok <out V > constructor (val value: V): Result<V, Nothing>() | |
// Operation finished with error | |
data class Err <out E> constructor (val error: E): Result<Nothing, E>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val gson = GsonBuilder() | |
.registerTypeHierarchyAdapter(Result::class.java, ResultSerializer()) | |
.create() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ResultSerializer : JsonSerializer<Result<*, *>>, JsonDeserializer<Result<*, *>> { | |
override fun serialize(src: Result<*, *>?, | |
typeOfSrc: Type?, | |
context: JsonSerializationContext?): JsonElement? { | |
// TODO | |
} | |
override fun deserialize(json: JsonElement?, | |
typeOfT: Type?, |
OlderNewer