In this step, we going finally write our first Extension plugins, at first we will assign our reducer to the global redux store, and then will plugin into the Router container mapDispatchToProps.
3. What we want to succeed is to load all related to social share configurations on the initial page load.
The same way that ConfigReducer does.
In Router Container we can find initializeApplication method which is calling initial prop method init(); here is our source theme mapDispatchToProps and initializeApplication
src/component/Router/Router.container.js line 62 - 83
Of course, we could plugin into mapDispatchToProps add new prop, then plugin into initializeApplication call original method and then ours, but it would be too boring, that why we going to plugin just in mapDispatchToProps and then going to mutate init prop method,letβs begin, In you <SOURCE>/plugin create the file RouterContainerMDTP.plugin.js
2. OpenRedux DevToolsyou should see SocialShareReducer object initial state.
look into SocialShare.reducer.js lines 4 - 8
4. Now restart your frontend and openRedux DevToolsyou should find SocialShareReducer object with value coming from the backend from our resolver check
ScandiPWA/SocialShareGraphQl/Model/Resolver/SocialShare.php line 27 -32