Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
typedef TaskNotifier = void Function(VoidCallback notify); | |
typedef TaskWorker = Stream<void> Function(TaskNotifier notifier); |
This file contains hidden or 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 'dart:async'; | |
Future<void> foo() async { | |
await for (final i in Stream<int>.periodic(const Duration(milliseconds: 500), (x) => x)) { | |
print('$i'); | |
} | |
} | |
void main() async { | |
// once this is awaited, the inner implicit stream subscription is uncancalleble |
This file contains hidden or 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 'dart:async'; | |
import 'dart:math'; | |
import 'package:equatable/equatable.dart'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_bloc/flutter_bloc.dart'; | |
import 'package:rxdart/rxdart.dart'; | |
// |
This file contains hidden or 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
public final class AnimUtil { | |
public static final ViewAction VISIBLE_RESET = new ViewAction() // | |
.visibility(View.VISIBLE).alpha(1f).scale(1f).translationX(0).translationY(0).lock(); | |
public static final ViewAction GONE_RESET = new ViewAction() // | |
.visibility(View.GONE).alpha(1f).scale(1f).translationX(0).translationY(0).lock(); | |
public static final ViewAction VISIBLE_RESET_ZERO_ALPHA = new ViewAction() // | |
.visibility(View.VISIBLE).alpha(0f).scale(1f).translationX(0).translationY(0).lock(); |
This file contains hidden or 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 UIKit | |
import RxSwift | |
class RxCollectionView<Element : Comparable>: UICollectionView, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout { | |
public typealias E = Element | |
var elements : [E] = [] | |
public var cellSizeChooser : (RxCollectionView<E>, E, Int) -> CGSize = { cv, _, _ in | |
let dim = cv.bounds.size.width / 3.0 |
This file contains hidden or 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 RxSwift | |
public protocol StringProtocol {} | |
extension String : StringProtocol {} | |
public typealias JSON = [String : AnyObject] | |
extension ObservableType where Self.E == Any? { | |
public func mapToJSON() -> RxSwift.Observable<JSON> { |
This file contains hidden or 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 RxSwift | |
extension UIButton { | |
public func throttledTapObservable(_ throttle : RxTimeInterval = 1.0) -> RxSwift.Observable<Swift.Void> { | |
return self.rx.tap.asObservable() | |
.throttle(throttle, latest: false, scheduler: MainScheduler.instance) | |
} | |
} |
This file contains hidden or 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 Alamofire | |
import RxSwift | |
extension DataRequest { | |
public func observeResponseJSON() -> Observable<Any?> { | |
let original = self.request! | |
return Observable.create { observer in |
NewerOlder