-
Notifications
You must be signed in to change notification settings - Fork 18
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
Swift 3.0 compatibility #22
Comments
For reference, this fork is an attempt to migrate the project to Swift 3 |
I will work on it in the coming weeks. I would like to remove some unnecessary parts like the Also the versioning came out of control 😅 if I introduce the API breaking changes by following the semantic versioning the next version should be 5.0. What do you think should I just bump the version to 4.1? If you have any suggestions, please share them here. Much appreciated! |
Yay!!1 |
Im working on it on the SignalKit-5.0 branch. I refactored the Of course we can create a thread safe // non-thread safe
let age = Signal<Int>()
let name = Signal<String>(value: "John")
// thread safe
let age = Signal<Int>(lock: MutexLock())
let name = SignalValue<String>(value: "John", lock: MutexLock())
// thread safe
let age = Signal<Int>.atomic()
let name = SignalValue<String>.atomic(value: "John") Hope to hear your feedback 😃 |
Yay! 🎉 Awesome work, Yanko! Thank you! |
You are right its more cleaner as an initializer parameter, so I refactored it to: let name = Signal<String>(atomic: true) Probably because // with SignalProperty
let name = SignalProperty<String>(value: "John", atomic: true)
name.bindTo(textIn: nameLabel).disposeWith(bag) // nameLabel.text is now "John"
// with Signal
let name = Signal<String>(atomic: true)
name.bindTo(textIn: nameLabel).disposeWith(bag)
name.send("John") // we have to send the initial value after we have signal observers Also I added Thanks! |
Wow! That is great that you designate this functionality (SignalProperty) as a first class citizen of SignalKit! Really, these are different and equally important concepts and we have to have them both! Personally, I slightly prefer to name |
I like the idea. Here are some explorations for a signal that reacts to new observers by sending them its current value:
|
How about Swift 3.0 compatible version or branch?
The text was updated successfully, but these errors were encountered: