title: Passing payload between actions in Angular/Ngrx
body: <p>I am a newbie in the Angular/Ngrx world, and I am using it in an application as below. I will try to explain the issue as best as I can.</p>
  <p>We have a main page that has 2 components - a configuration page, and a confirmation alert (initially hidden). The user can change configuration and the state of the page is stored in a <code>MyPageConfig</code> object. On clicking &quot;Save&quot; on this page, an action is triggered and the confirmation alert is shown. On clicking &quot;Confirm&quot; on the alert, the data should be persisted by calling a backend API.</p>
  <p>I have this in the HTML of the main page:</p>
  <pre><code>&lt;ng-template #whenLoaded&gt; 
    &lt;configure-page [doSubmitForm]=&quot;submitForm&quot;&gt;&lt;/configure-page&gt;        
    &lt;confirm-delete [remove-config]=&quot;removeConfig$&quot; 
              (onCancel)=&quot;handleCancel()&quot; (onConfirm)=&quot;handleConfirm()&quot;&gt;&lt;/confirm-delete&gt;            
  &lt;/ng-template&gt;
  </code></pre>
  <p><code>removeConfig$</code> is a boolean Observable I am listening to, but not making use of at this time.</p>
  <p>I have these following 2 handlers in the TS file of the main page:</p>
  <pre><code>handleCancelRemove() {
      this.store.dispatch(new actions.CancelRemoval());
  }
  
  handleConfirmRemove() {
      this.store.dispatch(new actions.ConfirmRemoval());    
  }
  </code></pre>
  <p>Note that no payload is being sent to <code>handleConfirmRemove</code> since this page itself is unaware of the configuration changes.</p>
  <p>In the <code>doSubmitForm</code> handler of the configuration page, I am showing the confirmation message dialog as this:</p>
  <pre><code>if (some condition) {
      this.store.dispatch(new actions.ShowConfirmationDialog());
      // Here we have the payload and can use it somehow? 
      // But the &quot;confirm&quot; button click is handled in the TS of the main page.
  }
  </code></pre>
  <p>It shows the dialog. But I am stuck on how to pass the configuration payload to persist it. I can write an <code>effect</code>, but in order to do this, I need the <code>ConfirmRemoval()</code> action to pass the payload which happens to be on the main page.</p>
  <p>In my mind there are 2 potential solutions, but I do not know how to work them out:</p>
  <ol>
  <li>Pass the payload from the child (config) page to the parent (main) page, and it will submit it with the action handler for the confirmation button click.</li>
  <li>Have the parent (main) page be aware of the config changes (i.e. the form state), and it creates and submit the payload directly with the action handler for the confirmation button click.</li>
  </ol>
  <p>Any suggestion on how this can be accomplished will be greatly appreciated.</p>