Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
DominikStyp / bubble.md
Created May 7, 2022 23:17 — forked from loilo/bubble.md
Make Vue events bubble

Make Vue events bubble

Vue events don't bubble the component tree on their own. However when writing wrapper components this can be the desired behaviour.

This code registers a global bubble directive which allows to re-emit all given events:

Let's say we want to bubble events start, accelerate and brake of our component Car.

Without any help, we'd roughly have to do this:

@DominikStyp
DominikStyp / guzzle_req_res_middleware.php
Created April 15, 2022 10:19 — forked from appkr/guzzle_req_res_middleware.php
Guzzle RequestResponseLog Middleware Example
<?php
namespace App\Providers;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use GuzzleHttp\Promise\PromiseInterface;
use Illuminate\Contracts\Foundation\Application;