Skip to content

Instantly share code, notes, and snippets.

View p-larson's full-sized avatar

Peter Larson p-larson

View GitHub Profile
@taskcruncher
taskcruncher / BaseStateExampleWithGenericAppState.swift
Last active August 8, 2023 17:09
BaseStateExampleWithGenericAppState.swift
//How to use BaseState struct to share state between views in TCA architecture.
// https://forums.swift.org/t/best-practice-for-sharing-data-between-many-features/37696/4
//This is a proof-of-concept only; it simply is an attempt to model how to get and set global shared state among different views in a TCA-style app.
import SwiftUI
import ComposableArchitecture
@dynamicMemberLookup
struct TCABaseState<State: Equatable>: Equatable{
@p-larson
p-larson / Tasky.java
Last active December 14, 2019 20:34
Util for BukkitRunnables
package com.wowserman;
import java.lang.ref.WeakReference;
import java.util.function.Consumer;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
/**
* Tasky.java