Very simple Kotlin caching library

Related tags

Kotlin kotlin simple test
Overview

nestegg

Very simple Kotlin caching library

License Maven Central


Download

implementation("xyz.runnerbe:nestegg:${version}")

Usage

fun <T> T.egg(vararg key: String): T // caching data

fun <T> pick(vararg key: String): T? // get cached data or null if no cached

fun <T> pickOrElse(vararg key: String, or: () -> T): T // get cached data or execute `or` block

fun <T> pickOrEgg(vararg key: String, or: () -> T): T // get cached data or execute `or` block and caching it

suspend fun <T> pickOrSuspendElse(vararg key: String, or: suspend () -> T): T

suspend fun <T> pickOrSuspendEgg(vararg key: String, or: suspend () -> T): T

Example

Want example usage? Please see test code.

Caution

This library is designed for RunnerBe-Android development.


Happy Coding :)

You might also like...
Simple Android Library, that provides easy way to start the Activities with arguments.

Warning: Library is not maintained anymore. If you want to take care of this library, propose it via Pull Request. It needs adjustmensts for newer ver

Simple Service Locator Library

ScrapServiceLocator A small, asynchronous IoC library for Android that might be half compile-time safe (?) Before I start, I'm very poor at English, s

This library is a set of simple wrapper classes that are aimed to help you easily access android device information.
This library is a set of simple wrapper classes that are aimed to help you easily access android device information.

SysInfo Simple, single class wrapper to get device information from an android device. This library provides an easy way to access all the device info

A lightweight, simple, smart and powerful Android routing library.

RxRouter Read this in other languages: 中文, English A lightweight, simple, smart and powerful Android routing library. Getting started Setting up the d

Simple and light-weight event dispatcher for Kotlin

KDispatcher is a Kotlin EventDispatcher This is light-weight event dispatcher based on KOTLIN priority: Int? = null to subscribe function for sorting

Nice and simple DSL for Espresso in Kotlin
Nice and simple DSL for Espresso in Kotlin

Kakao Nice and simple DSL for Espresso in Kotlin Introduction At Agoda, we have more than 1000 automated tests to ensure our application's quality and

A simple Kotlin wrapper around Anvil.

AnvilKotlin A simple Kotlin wrapper around Anvil. The only purpose of this library is to provide type safety to Anvil through Kotlin. Nothing more, no

A simple way to handle remote image in Kotlin.
A simple way to handle remote image in Kotlin.

Parrot A kotlin extension to load easily remote images in your ImageView. Install Add to gradle in allprojects maven { url 'https://jitpack.io' } the

Dead simple EventBus for Android made with Kotlin and RxJava 2

KBus Super lightweight (13 LOC) and minimalistic (post(), subscribe(), unsubscribe()) EventBus written with idiomatic Kotlin and RxJava 2 KBus in 3 st

Owner
Ji Sungbin
@toss @banksalad @daangn 준비중
Ji Sungbin
A composite Github Action to execute the Kotlin Script with compiler plugin and dependency caching!

Kotlin Script Github Action Kotlin can also be used as a scripting language, which is more safer, concise, and fun to write than bash or python. Githu

Suresh 9 Nov 28, 2022
AsyncSport - AsyncSports Async sports is very simple application that shows athletes video feeds

AsyncLabs Interview Solution ?? Writing AsyncLabs Interview Solution App using A

David Innocent 0 Jan 7, 2022
Koin Annotations - help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you

The goal of Koin Annotations project is to help declare Koin definition in a very fast and intuitive way, and generate all underlying Koin DSL for you. The goal is to help developer experience to scale and go fast ?? , thanks to Kotlin Compilers.

insert-koin.io 68 Jan 6, 2023
🚟 Lightweight, and simple scheduling library made for Kotlin (JVM)

Haru ?? Lightweight, and simple scheduling library made for Kotlin (JVM) Why did you build this? I built this library as a personal usage library to h

Noel 13 Dec 16, 2022
A lightweight and simple Kotlin library for deep link handling on Android 🔗.

A lightweight and simple Kotlin library for deep link handling on Android ??.

Jeziel Lago 101 Aug 14, 2022
A Kotlin library providing a simple, high-performance way to use off-heap native memory in JVM applications.

native_memory_allocator A library which uses sun.misc.Unsafe to allocate off-heap native memory. Motivation The goal of this project is to provide a s

Target 5 Dec 8, 2022
RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

RoomJetpackCompose is an app written in Kotlin and shows a simple solution to perform CRUD operations in the Room database using Kotlin Flow in clean architecture.

Alex 27 Jan 1, 2023
A simple library that can connect your autocomplete edittext to Google places api

Google Places AutoComplete EditText A simple library that can connect your autocomplete edittext to Google's places api Supporting Places AutoComplete

Mukesh Solanki 71 Dec 28, 2022
Simple android library to present an animated ferris wheel

Ferris Wheel View Overview An Android Library used to implement an animated Ferris Wheel in android. API SDK 15+ Written in Kotlin Supports landscape

Igor Lashkov 318 Dec 7, 2022