Skip to content

Instantly share code, notes, and snippets.

@engineersamuel
Created November 8, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save engineersamuel/c3f2bf966bfb72fb6d5c1219dd9b592b to your computer and use it in GitHub Desktop.
Save engineersamuel/c3f2bf966bfb72fb6d5c1219dd9b592b to your computer and use it in GitHub Desktop.
interface IActionProductName { productName: string; }
interface IActionProductVersion { productVersion string; }
 
const requestUpdateProductVersion = createAction<interfaces.IActionProductName & interfaces.IActionProductVersion, void>(types.REQUEST_UPDATE_PRODUCT_VERSION,
    (productName: string, productVersion: string) => ({productName, productVersion}),
    null
);
const receiveUpdateProductVersion = createAction<interfaces.IActionProductName & interfaces.IActionProductVersion, interfaces.IMetaIsXhrError>(types.RECEIVE_UPDATE_PRODUCT_VERSION,
    (productName: string, productVersion: string) => ({productName, productVersion}),
    isXhrError
);
 
[types.RECEIVE_UPDATE_PRODUCT_VERSION]: (state: ICaseDetailsState, action: ActionMeta<interfaces.IActionProductName & interfaces.IActionProductName, interfaces.IMetaIsXhrError>): ICaseDetailsState => {
    // ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment