import React, { Component } from 'react'; class Foo { constructor(props) { super(props); this.tokens = []; } componentWillUnmount() { // Cancel all the tokens generated within this component this.tokens.forEach(token => { token.abort(); }); } makeRequest() { const controller = new AbortController(); this.tokens.push(controller); // Use this signal for Fetch dispatch('ACTION_REQUEST', { signal: controller.signal }); } }