Skip to content

Conversation

@andersio
Copy link
Member

Fixes #142

Copy link
Contributor

@sharplet sharplet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a test for this?

var property: MutableProperty<Bool>? = MutableProperty(false)
weak var weakProperty = property

var action: Action<(), (), NoError>? = Action(state: property!, enabledIf: { _ in true }) { _ in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is triggering a "variable is written to but never read" warning. Mind changing this to a let constant? Probably doesn't need to be optional either.

Copy link
Member Author

@andersio andersio Dec 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is part of the test case. action is set to nil below to test if the property is really retained by the Action.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

@mdiep mdiep merged commit 253a8d9 into master Dec 15, 2016
@mdiep mdiep deleted the action-retaining branch December 15, 2016 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants