hailwood

@walmsles

Files: Requires logging in with Slack to view/download
Pleeease
hailwood

Could I convince you to tag a 1.0 release? XD I feel like 0.x releases are the equivalent of using dev-master as it means the api could change at any time since it's not finalized

walmsles

I built a small light weight callback system loosely based on Laravel Events just for fun a few months back

walmsles

@hailwood sounds like an event style system would handle this scenario. Register a callback to do the data load and then fire where appropriate and pass in context

hailwood

Context here - I have a TemplateGlobalProvider that returns an "inital state" which is a json_encoded array. before we json encode it we hook into a proper object and call $object->extend('updateInitialState', $state); Now if the page I'm viewing is a Product then we need to load some information about this Product into the initial state, so that's why we're after wanting to hook into that but only on this specific page type.

flamerohr

methods have a similar issue, where if it's dynamically loaded, you'd need to check if that method exists before calling (in PHP)