Log in
Seblog.nl

Reacties

als antwoord op sebsel

Thanks @github.com/lootjs, I have seen Hub before, and I thought it did something else. I tried again, hoping that I missed something, but I don't think this is what I need here.

I think the idea of the Hub is that one can have multiple pipelines, with names, and that you can dispatch to those pipelines by name. In my example above, I have one pipeline and want to reuse that one pipeline. That does not match.

Example for how I think Hub works:

function prependFoo($thing, $next) {
    return $next('foo' . $thing);
}

function appendBar($thing, $next) {
    return $next($thing . 'bar');
}

$hub = new Illuminate\Pipeline\Hub();

$hub->defaults(function ($pipeline, $thing) {
    return $pipeline->send($thing)
        ->through(['prependFoo', 'appendBar'])
        ->then(fn($n) => $n);
});

$hub->pipeline('only-foo', function ($pipeline, $thing) {
    return $pipeline->send($thing)
        ->through(['prependFoo'])
        ->then(fn($n) => $n);
});

$hub->pipe('thing'); // "foothingbar"
$hub->pipe('thing', 'only-foo'); // "foothing"

Note that Hub does not it's Container to resolve Pipeline (just news it), and that it gives a new instance of Pipeline every time you call pipe() on it, which is quite the opposite of what I want.

Hub also seems to be a bit forgotten: it is not used by the framework itself, is not documented and does not have tests. It feels like an experiment for Middleware groups that went nowhere? (But that's speculating, probably @taylorotwell knows.)

But most of all: no, I don't think that does what I mean.

als antwoord op Sebastian De Deyne

Just want to point out that you don't have to rely on webmention.io to use Webmentions... they are just POST requests with a form-encoded body of source and target. My blog hosts it's own endpoint, which means I own the whole process.

But it sounds like a sweet setup!

als antwoord op Malcolm Blaney

I just watched Spider-Man: Homecoming and it was really good! But then again: I'm more into ánd pleasantly surprised by all the character developments in this series. The action is nice, but the Avengers movies get a bit too safe-all-the-things-o-no-the-bad-guys-got-us-hah-we-won-anyways sometimes ;)

als antwoord op Sven

Lol, you are right, it was late. I wrote this tweet in reply to some tweet I saw, but I did not want to bother them by actually mentioning it, and now I lost the tweet. Pretty sure I've seen it at least once before, in the context of Kubernetes, talking about the 'physical VM'.

als antwoord op Stefan Bauer

What is especially ‘Laravel community’ about this picture? I see a small homogenous group at a fancy table. I would like to see the community as a bigger, more inclusive group. Still, great that you had a nice evening with these people :)

als antwoord op Saša Jurić

You need a certain confidence in writing your own authz-code. Part of the value of the package is verfication that it is a proved pattern. I think that would especially apply to auth(n), as we are thaught not to roll our own. But this seems very straightforward once you read it.

als antwoord op Sebastiaan Andeweg

Ah, I think I got myself an answer: the const variant does not allow re-definition of the function, while the function variant does. I still don't think the benefit that brings outweighs the ugliness of it. Can I have a new keyword like fn or something to solve this?

als antwoord op Raj Chauhan

Feels even more useful with reduce():

console.log([
  x => x + 36,
  x => `The answer is ${x}!`,
  x => x.toUpperCase(),
].reduce((x, fn) => fn(x), 6));
// THE ANSWER IS 42!
als antwoord op JohnB

Oh, no I got links to neither... I was not actually planning on sending this in to the contest, it feels too simple. But I might clean it up and send it in, and then those links will come. (Also: what is the licensing model behind Tetris?)

Mobile is hard, btw, because Tetris relies on buttons so much. I can add some buttons to the page, but I'm afraid the game play won't be as good. Most mobile Tetrises I've seen do fancy things with gestures, but it always feels odd to me. It's just not a touch game :)

als antwoord op Caleb Porzio

Hah, I thought you made an app to digitally manage the stickers on your laptop. That widget you got is so close. Plz provide a way to import stickers ;)

als antwoord op Sebastiaan Andeweg

The only downside I see now is that you are binding your components to your GraphQL schema, but since that has reasonable deprecation management I think I'm okay with that.

als antwoord op Chris Toomey

Thanks! I'm considering introducing it to a project. It uses JS and Vue, but I think it can still be a match. A lot of props get passed around through many components, and this could be a way to just pass the whole object but still make sure all the fields are present.

als antwoord op twitter.com

Been there! Not no mention refactoring everything four times because I might open source stuff at some point and I want it to look nice and properly modularized. Just keep chipping away at it and try to ship something.

Meer laden