nostriphant/functional-alternate

Functionally alternating logical paths

1.1 2024-11-20 12:32 UTC

This package is auto-updated.

Last update: 2024-11-20 13:10:01 UTC


README

Functionally alternating logical paths

Usage

use nostriphant\FunctionalAlternate\Alternate;

$state = Alternate::state1('Hello World!');

$evaluate = $state(state1: function (string $message) {
    yield $message;
});

foreach ($evaluate as $message) {
    expect($message)->toBe('Hello World!');
}