-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Recorded<Event<T>>
array factory method
#1531
Add Recorded<Event<T>>
array factory method
#1531
Conversation
Generated by 🚫 Danger |
I'm not sure if we should use this method to create empty array or single element array? // empty array
- let events: [Recorded<Event<Int>>] = []
+ let events = Recorded<Event<Int>>.events()
// single element array
- let messages = [
- Recorded.error(250, testError, Int.self)
- ]
+ let messages = Recorded.events(
+ .error(250, testError, Int.self)
+ ) |
CHANGELOG.md
Outdated
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file. | |||
|
|||
## Master | |||
|
|||
* Add `Recorded<Event<T>>` arry factory method in **RxText**. #1531 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds Recorded<Event<T>>
array factory method in RxTest. #1531
RxTest/Recorded+Event.swift
Outdated
extension Recorded { | ||
|
||
/** | ||
Factory method for an array of recorded events, this may help if you don't want to declare the type of array: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe formulate this sentence in some impersonal form:
Convenience method for recording a sequence of events. Its primary use case is improving readability in cases where type inference is unable to deduce the type of recorded events.
I'm hoping somebody will provide us some help with the docs, I'm not pleased with my formulation either.
RxTest/Recorded+Event.swift
Outdated
|
||
|
||
/** | ||
Factory method for an array of recorded events, this may help if you don't want to declare the type of array: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue with docs.
RxTest/Recorded+Event.swift
Outdated
] | ||
``` | ||
|
||
- parameter recordedEvents: The recorded events which will return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just say:
- parameter recordedEvents: Method return value.
RxTest/Recorded+Event.swift
Outdated
] | ||
``` | ||
|
||
- parameter recordedEvents: The recorded events which will return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs.
Thanks @kzaher I've improved the documentation as you requested. |
Hi there~~
This PR is an extension to #1510.
Introducing
Recorded<Event<T>>
array factory method:This may help if you don't want to declare the type when create recorded events: