June 2017
Intermediate to advanced
536 pages
9h 49m
English
Though RxPHP provides over 40 operators for us to use, sometimes, there may be a need to use an operator that does not exist. Consider the following case:
<?phprequire_once __DIR__ . '/vendor/autoload.php';use \Rx\Observer\CallbackObserver;use \React\EventLoop\Factory;use \Rx\Scheduler;$loop = Factory::create();Scheduler::setDefaultFactory(function () use ($loop) { return new Scheduler\EventLoopScheduler($loop);});// correct$users = serialize(['John', 'Mariya', 'Marc', 'Lucy']);// faulty// $users = str_replace('i:', '', serialize(['John', 'Mariya', 'Marc', 'Lucy']));$observer = new CallbackObserver( function ($value) { echo 'Observer.$onNext: ', print_r($value, true), PHP_EOL; }, function (\Throwable $t) { echo ...