Skip to content

Conversation

@someyura
Copy link
Contributor

@someyura someyura commented Nov 6, 2025

Motivation

The existing prepend and append functions requires passing an instance of the Element type, which leads to the following code when the Element is Void:

var mySignal: Signal<Void, Never>()
...
mySignal.prepend(()) // we have to pass () to avoid compilation error
mySignal.append(()) // we have to pass () to avoid compilation error

that seems unnecessary as all instances of Void as the same.

Change

I've added a specialized extension with an overload for the prepend and append functions. It will allow calling them without passing any parameters.

var mySignal: Signal<Void, Never>()
...
mySignal.prepend() 
mySignal.append() 

Compatibility

This change is strictly additive and is fully compatible with existing code.

Tests

On a local run all tests were passed successfully ✅

@srdanrasic srdanrasic merged commit 5c61e08 into DeclarativeHub:master Nov 6, 2025
2 of 3 checks passed
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.

2 participants