aws-mobile-appsync-sdk-js icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-js copied to clipboard

Upgrade to latest redux-offline

Open manueliglesias opened this issue 7 years ago • 3 comments

We need to upgrade to the latest redux-offline, see #276

manueliglesias avatar Oct 30 '18 22:10 manueliglesias

any chances this will be fixed any time soon? it is still borked in appsync 1.7.0, doesn't work in typescript:

  Try `npm install @types/redux-offline__redux-offline` if it exists or add a new declaration (.d.ts) file containing `declare module '@redux-offline/redux-offline/lib/types';`  TS7016

    2 | import { AWSAppSyncClient, OfflineCallback } from './client';
    3 | import { NormalizedCacheObject, IdGetter } from 'apollo-cache-inmemory';
  > 4 | import { NetInfo, NetworkCallback } from '@redux-offline/redux-offline/lib/types';
      |                                          ^
    5 | declare const newStore: <TCacheShape extends NormalizedCacheObject>(clientGetter: () => AWSAppSyncClient<TCacheShape>, persistCallback: () => any, dataIdFromObject: (obj: any) => string, storage: any, callback?: OfflineCallback) => Store<any>;
    6 | export declare type OfflineEffectConfig = {
    7 |     enqueueAction: string;```

kaievns avatar Dec 28 '18 04:12 kaievns

A workaround, for the interim.

AndrewKvalheim avatar Jan 24 '19 19:01 AndrewKvalheim

This issue breaks typescript compilation for any project using aws-appsync. @AndrewKvalheim 's solution works, for convenience, directly adding the code here:

Place a typings.d.ts file at project root:

declare module '@redux-offline/redux-offline/lib/types' {
  export type NetInfo = any;
  export type NetworkCallback = any;
}

ajhool avatar Mar 12 '21 17:03 ajhool