Skip to content

Instantly share code, notes, and snippets.

View n8chur's full-sized avatar
🏠
Working from home

Westin Newell n8chur

🏠
Working from home
View GitHub Profile
@n8chur
n8chur / Published.swift
Last active March 2, 2022 06:41
An example implementation of @published from Swift's Combine framework along with an "immutable" variant.
import Combine
/**
An observable, mutable property.
Replays the current value when subscribed.
*/
@propertyWrapper
struct Published<Output>: Publisher {
typealias Failure = Never
@n8chur
n8chur / Example-Split-CLA.md
Last active September 4, 2019 21:13
An example for a CLA that has two separate agreements for individuals and corporations for use with cla-assistant.io.
Individuals Corporations
@n8chur
n8chur / SwiftUI-Class-Update-Failure.swift
Created June 6, 2019 23:08
Demonstrates that SwiftUI (in it's initial beta form) is unable to properly handle diffing of class objects. The counter will not increment as you might expect it to.
import SwiftUI
import Combine
struct ContentView : View {
@ObjectBinding var viewModel: ViewModel
var body: some View {
CounterView(counter: viewModel.counter)
}
}

Keybase proof

I hereby claim:

  • I am n8chur on github.
  • I am n8chur (https://keybase.io/n8chur) on keybase.
  • I have a public key whose fingerprint is 89FC F8C4 8102 E735 305A E268 7A89 793B EB6E 6C3C

To claim this, I am signing this object: