Open levity opened 8 years ago
The migration is fairly simple, basically all you need to do is to switch the names. The main difference is rather than use defer and prefetch directly their argument just gets passed to either the fetch or defer key in the provideHooks object.
very light examples:
//before
prefetch( /* function that dispatches goes here */);
defer( /* function that dispatches goes here */);
//after
provideHooks({
fetch: /* function that dispatches goes here */,
defer: /* function that dispatches goes here */,
});
Server side / control code is also fairly simple.
//before
getDeferredData(components, obj);
//after
trigger('defer', components, obj);
I have an app that uses the
prefetch
decorator, from redial's previous life as react-fetcher, thirty-plus times. I'd like to upgrade to redial for the ability to attach arbitrary lifecycle hooks even to stateless components, but I'm not looking forward to what promises to be a tedious migration... Has anyone written code to ease the migration or to continue supporting the oldprefetch
anddefer
decorators with the new version?