Skip to content

Instantly share code, notes, and snippets.

@wildeyes
Created October 24, 2017 11:13
Show Gist options
  • Save wildeyes/fa0dd7a30f6134c16286f14fdd9ca533 to your computer and use it in GitHub Desktop.
Save wildeyes/fa0dd7a30f6134c16286f14fdd9ca533 to your computer and use it in GitHub Desktop.
Lying to the typesystem
// const getPortfoliosSync = createActionWithoutAlsoTyingDispatch(() => ({}));
const createActionWithoutAlsoTyingDispatchAsync = <T>(getMeAPromise: () => Promise<T>) => {
const retValue: any = () => {
return;
};
return retValue as Promise<T>;
};
const getPortfoliosAsync = createActionWithoutAlsoTyingDispatchAsync(() => Promise.resolve(1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment