Skip to content

Instantly share code, notes, and snippets.

View pantos27's full-sized avatar
๐Ÿ’…
coding makes my nails polish peel

Amir A pantos27

๐Ÿ’…
coding makes my nails polish peel
View GitHub Profile
viewModel.viewState.observe(viewLifecycleOwner) { state ->
state takeIfSuccess {
// Here's the success state
} takeIfError {
// Here's the error state
}
}
@pantos27
pantos27 / deploy.yml
Created August 8, 2021 14:42
Github action to auto deploy to branch QA once a new version tag is created
name: deploy-to-qa
on:
workflow_dispatch:
push:
tags: [ 'v*' ]
jobs:
update_qa:
runs-on: ubuntu-latest
steps:
@pantos27
pantos27 / A-Kotlin-Delegates.md
Created December 1, 2021 14:31 — forked from amir-dropit/A-Kotlin-Delegates.md
Kotlin delegates examples

Some Kotlin delegates examples

  • property delegates and class delegates
@pantos27
pantos27 / PromiseWrapper.ts
Created April 13, 2024 11:13
A typescript way to use React Suspnse blocks with simple promises
const promiseWrapper = <T> (promise: Promise<T>): () => T => {
let status = "pending";
let result: T;
const s = promise.then(
(value) => {
status = "success";
result = value;
},
(error) => {