New test for `publish.when()` both sync and async.
Added `publish.when` and maintained backward compatibility with pubit.