Skip to content

Instantly share code, notes, and snippets.

View mdjastrzebski's full-sized avatar
👋

Maciej Jastrzebski mdjastrzebski

👋
View GitHub Profile
import Flutter
import React
import UIKit
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
import { useEffect } from 'react'
export class Timer {
name: string
lastTimestamp = 0
counts = new Map<string, number>()
durations = new Map<string, number>()
totalDuration = 0
totalCount = 0
@mdjastrzebski
mdjastrzebski / use-latest-prop-value.ts
Created August 14, 2025 13:11
use-latest-prop-value
/**
* Returns the latest value of given prop as a ref.
*
* This function allows treating given prop as a non-reactive value, that should be
* accessible in `useEffect` but does not trigger effect re-run.
*
* @param value - The prop value to be used as a ref
* @returns A ref that will always hold the latest value of the prop
*/
function useLatestPropRef<T>(value: T) {