//
// RACSignal+Operations.h
// ReactiveCocoa
//
// Created by Justin Spahr-Summers on 2012-09-06.
// Copyright (c) 2012 GitHub, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "RACSignal.h"
/// The domain for errors originating in RACSignal operations.
extern NSString * const RACSignalErrorDomain;
/// The error code used with -timeout:.
extern const NSInteger RACSignalErrorTimedOut;
/// The error code used when a value passed into +switch:cases:default: does not
/// match any of the cases, and no default was given.
extern const NSInteger RACSignalErrorNoMatchingCase;
@class RACCommand;
@class RACDisposable;
@class RACMulticastConnection;
@class RACScheduler;
@class RACSequence;
@class RACSubject;
@class RACTuple;
@protocol RACSubscriber;
@interface RACSignal (Operations)
/// Do the given block on `next`. This should be used to inject side effects into
/// the signal.
- (RACSignal *)doNext:(void (^)(id x))block;
/// Do the given block on `error`. This should be used to inject side effects
/// into the signal.
- (RACSignal *)doError:(void (^)(NSError *error))block;
/// Do the given block on `completed`. This should be used to inject side effects
/// into the signal.
- (RACSignal *)doCompleted:(void (^)(void))block;
/// Sends `next`s only if we don't receive another `next` in `interval` seconds.
///
/// If a `next` is received, and then another `next` is received before
/// `interval` seconds have passed, the first value is discarded.
///
/// After `interval` seconds have passed since the most recent `next` was sent,
/// the most recent `next` is forwarded on the scheduler that the value was
/// originally received on. If +[RACScheduler currentScheduler] was nil at the
/// time, a private background scheduler is used.
///
/// Returns a signal which sends throttled and delayed `next` events. Completion
/// and errors are always forwarded immediately.
- (RACSignal *)throttle:(NSTimeInterval)interval;
/// Throttles `next`s for which `predicate` returns YES.
///
/// When `predicate` returns YES for a `next`:
///
/// 1. If another `next` is received before `interval` seconds have passed, the
/// prior value is discarded. This happens regardless of whether the new
/// value will be throttled.
/// 2. After `interval` seconds have passed since the value was originally
/// received, it will be forwarded on the scheduler that it was received
/// upon. If +[RACScheduler currentScheduler] was nil at the time, a private
/// background scheduler is used.
///
/// When `predicate` returns NO for a `next`, it is forwarded immediately,
/// without any throttling.
///
/// interval - The number of seconds for which to buffer the latest value that
/// passes `predicate`.
/// predicate - Passed each `next` from the receiver, this block returns
/// whether the given value should be throttled. This argument must
/// not be nil.
///
/// Returns a signal which sends `next` events, throttled when `predicate`
/// returns YES. Completion and errors are always forwarded immediately.
- (RACSignal *)throttle:(NSTimeInterval)interval valuesPassingTest:(BOOL (^)(id next))predicate;
/// Forwards `next` and `completed` events after delaying for `interval` seconds
/// on the current scheduler (on which the events were delivered).
///
/// If +[RACScheduler currentScheduler] is nil when `next` or `completed` is
/// received, a private background scheduler is used.
///
/// Returns a signal which sends delayed `next` and `completed` events. Errors
/// are always forwarded immediately.
- (RACSignal *)delay:(NSTimeInterval)interval;
/// Resubscribes when the signal completes.
- (RACSignal *)repeat;
/// Executes the given block each time a subscription is created.
///
/// block - A block which defines the subscription side effects. Cannot be `nil`.
///
/// Example:
///
/// // Write new file, with backup.
/// [[[[fileManager
/// rac_createFileAtPath:path contents:data]
/// initially:^{
/// // 2. Second, backup current file
/// [fileManager moveItemAtPath:path toPath:backupPath error:nil];
/// }]
/// initially:^{
/// // 1. First, acquire write lock.
/// [writeLock lock];
/// }]
/// finally:^{
/// [writeLock unlock];
/// }];
///
/// Returns a signal that passes through all events of the receiver, plus
/// introduces side effects which occur prior to any subscription side effects
/// of the receiver.
- (RACSignal *)initially:(void (^)(void))block;
/// Executes the given block when the signal completes or errors.
- (RACSignal *)finally:(void (^)(void))block;
/// Divides the receiver's `next`s into buffers which deliver every `interval`
/// seconds.
///
/// interval - The interval in which values are grouped into one buffer.
/// scheduler - The scheduler upon which the returned signal will deliver its
/// values. This must not be nil or +[RACScheduler
/// immediateScheduler].
///
/// Returns a signal which sends RACTuples of the buffered values at each
/// interval on `scheduler`. When the receiver completes, any currently-buffered
/// values will be sent immediately.
- (RACSignal *)bufferWithTime:(NSTimeInterval)interval onScheduler:(RACScheduler *)scheduler;
/// Collects all receiver's `next`s into a NSArray. Nil values will be converted
/// to NSNull.
///
/// This corresponds to the `ToArray` method in Rx.
///
/// Returns a signal which sends a single NSArray when the receiver completes
/// successfully.
- (RACSignal *)collect;
/// Takes the last `count` `next`s after the receiving signal completes.
- (RACSignal *)takeLast:(NSUInteger)count;
/// Combines the latest values from the receiver and the given signal into
/// RACTuples, once both have sent at least one `next`.
///
/// Any additional `next`s will result in a new RACTuple with the latest values
/// from both signals.
///
/// signal - The signal to combine with. This argument must not be nil.
///
/// Returns a signal which sends RACTuples of the combined values, forwards any
/// `error` events, and completes when both input signals complete.
- (RACSignal *)combineLatestWith:(RACSignal *)signal;
/// Combines the latest values from the given signals into RACTuples, once all
/// the signals have sent at least one `next`.
///
/// Any additional `next`s will result in a new RACTuple with the latest values
/// from all signals.
///
/// signals - The signals to combine. If this collection is empty, the returned
/// signal will immediately complete upon subscription.
///
/// Returns a signal which sends RACTuples of the combined values, forwards any
/// `error` events, and completes when all input signals complete.
+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals;
/// Combines signals using +combineLatest:, then reduces the resulting tuples
/// into a single value using -reduceEach:.
///
/// signals - The signals to combine. If this collection is empty, the
/// returned signal will immediately complete upon subscription.
/// reduceBlock - The block which reduces the latest values from all the
/// signals into one value. It must take as many arguments as the
/// number of signals given. Each argument will be an object
/// argument. The return value must be an object. This argument
/// must not be nil.
///
/// Example:
///
/// [RACSignal combineLatest:@[ stringSignal, intSignal ] reduce:^(NSString *string, NSNumber *number) {
/// return [NSString stringWithFormat:@"%@: %@", string, number];
/// }];
///
/// Returns a signal which sends the results from each invocation of
/// `reduceBlock`.
+ (RACSignal *)combineLatest:(id<NSFastEnumeration>)signals reduce:(id (^)())reduceBlock;
/// Merges the receiver and the given signal with `+merge:` and returns the
/// resulting signal.
- (RACSignal *)merge:(RACSignal *)signal;
/// Sen
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
适用苹果,win平台,下载项目 执行打包代码,将应用程序使用,桌面出现可拖动动态时钟,代码简单,可自定义个性化 1、下载代码 2、建立依赖 3、yarn start/npm start 在线运行 4、yarn package/npm package 打包mac版本 5、yarn package:win/npm package:win 打包window版本
资源详情
资源评论
资源推荐
收起资源包目录
桌面应用程序-时钟svg (2000个子文件)
default_app.asar 99KB
v8_context_snapshot.bin 167KB
range.bnf 619B
range.bnf 619B
range.bnf 619B
chrome_crashpad_handler 974KB
svg.css 1KB
platelet.css 420B
Current 1B
Current 1B
Current 1B
Current 1B
icudtl.dat 10.02MB
errors.def 8KB
definitions.def 4KB
coerce.def 2KB
defaults.def 1KB
missing.def 1KB
.DS_Store 6KB
.DS_Store 6KB
libGLESv2.dylib 9.49MB
libvk_swiftshader.dylib 4.34MB
libswiftshader_libGLESv2.dylib 3.2MB
libffmpeg.dylib 2.88MB
libswiftshader_libEGL.dylib 225KB
libEGL.dylib 198KB
Electron 181KB
electron 18B
Electron Framework 117.96MB
Electron Framework 35B
Electron Helper 251KB
Electron Helper (GPU) 251KB
Electron Helper (Plugin) 251KB
Electron Helper (Renderer) 251KB
extract-zip 27B
extract-zip 21B
Agent.js.flow 7KB
createGlobalProxyAgent.js.flow 6KB
createLogger.js.flow 5KB
types.js.flow 2KB
types.js.flow 2KB
HttpsProxyAgent.js.flow 1KB
bindHttpMethod.js.flow 1KB
createMockLogger.js.flow 1KB
isUrlMatchingNoProxy.js.flow 1022B
log.js.flow 970B
createRoarrInititialGlobalState.js.flow 914B
createProxyController.js.flow 882B
parseProxyUrl.js.flow 874B
HttpProxyAgent.js.flow 733B
bootstrap.js.flow 550B
createNodeWriter.js.flow 520B
errors.js.flow 299B
index.js.flow 239B
index.js.flow 200B
index.js.flow 174B
index.js.flow 160B
Logger.js.flow 129B
constants.js.flow 116B
index.js.flow 100B
index.js.flow 60B
RACSignal+Operations.h 32KB
metamacros.h 30KB
RACStream.h 13KB
RACSignal.h 9KB
MTLManagedObjectAdapter.h 9KB
SQRLUpdater.h 8KB
MTLJSONAdapter.h 7KB
RACScheduler.h 7KB
RACSequence.h 6KB
RACTuple.h 5KB
MTLModel.h 5KB
MTLModel+NSCoding.h 5KB
RACCommand.h 5KB
NSObject+RACPropertySubscribing.h 5KB
RACKVOChannel.h 4KB
EXTScope.h 4KB
NSValueTransformer+MTLPredefinedTransformerAdditions.h 4KB
ReactiveCocoa.h 4KB
NSObject+RACSelectorSignal.h 4KB
RACBacktrace.h 3KB
RACChannel.h 3KB
NSObject+RACLifting.h 3KB
EXTKeyPathCoding.h 2KB
RACSubscriptingAssignmentTrampoline.h 2KB
RACMulticastConnection.h 2KB
NSObject+RACAppKitBindings.h 2KB
RACCompoundDisposable.h 2KB
RACSubscriber.h 2KB
RACSerialDisposable.h 2KB
RACEvent.h 2KB
RACTestScheduler.h 1KB
RACQueueScheduler+Subclass.h 1KB
NSDictionary+RACSequenceAdditions.h 1KB
NSObject+RACDeallocating.h 1022B
MTLValueTransformer.h 991B
SQRLUpdate.h 972B
SQRLDownloadedUpdate.h 963B
RACDisposable.h 941B
RACScheduler+Subclass.h 939B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
我是小白855
- 粉丝: 224
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- mybatis动态sql及其JAVA示例
- 微软常用运行库 游戏运行库 VC++各个版本
- 微信小程序开发教程.pptx
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- 锐捷网络认证中心网络管理.pdf
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
- SD8233LF是一款用于单按键触摸及接近感应开关,其用途是替代传统的机械型开关芯片IC
- 基于YOLOv5的烟雾火焰检测算法研究
- 基于STM32的联合调试侦听设备解决方案原理图PCB源文件调试工具视频(大赛作品)
- MyBatis动态SQL是一种强大的特性,它允许我们在SQL语句中根据条件动态地添加或删除某些部分,从而实现更加灵活和高效的数据
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0