This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Subscription<T> { | |
func perform(callback: () -> Void) { | |
} | |
func notify() { | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
struct State { | |
var posts: [Post.ID: Post] | |
var users: [User.ID: User] | |
var currentUser: User.ID? | |
} | |
struct Post { |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "total", | |
"start": 0, | |
"duration": 55799, | |
"nested": [ | |
{ | |
"name": "sort", | |
"start": 17, | |
"duration": 27749, | |
"nested": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.swift | |
// ReducerComponents | |
// | |
// Created by Alexey Demedetskii on 6/19/19. | |
// Copyright © 2019 Sigma software. All rights reserved. | |
// | |
import Foundation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
protocol ImplicitlyConvertible { | |
associatedtype ConversionResult | |
func convert() -> ConversionResult | |
} | |
@dynamicMemberLookup | |
struct Reader<State>: ImplicitlyConvertible { | |
let state: State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
protocol Primitive {} | |
extension Int: Primitive {} | |
@dynamicMemberLookup | |
struct Draft<Value> { | |
let value: Value | |
var updates: [PartialKeyPath<Value>: Any] = [:] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol _Reducer { | |
associatedtype State | |
associatedtype Action | |
func reduce(state: inout State, action: Action) | |
} | |
protocol Reducer: _Reducer where State == Body.State, Action == Body.Action { | |
associatedtype Body: Reducer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol Action {} | |
struct Reducer<State> { | |
let reduce: (State, Action) -> State | |
} | |
struct Increment: Action {} | |
struct Decrement: Action {} | |
func on<State, A>(_ actionType: A.Type, reduce: @escaping (State, A) -> State) -> Reducer<State> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Cocoa | |
class Observation<T>: Hashable { | |
var hashValue: Int { | |
return ObjectIdentifier(self).hashValue | |
} | |
static func ==(lhs: Observation<T>, rhs: Observation<T>) -> Bool { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Cocoa | |
var str = "Hello, playground" | |
struct Example: Codable { | |
let name: String | |
let age: Int | |
} |
NewerOlder