From 254573bba33ab15a1cfb102044223079921c82e6 Mon Sep 17 00:00:00 2001 From: Sebastian Martha Date: Sun, 9 Feb 2020 10:50:19 -0600 Subject: [PATCH] fix: Add missing types definition into CarouselStoreInterface (#237) * Add missing import into README.md * Add missing types definition into CarouselStoreInterface --- README.md | 2 +- typings/index.d.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1943024b..44e53460 100644 --- a/README.md +++ b/README.md @@ -541,7 +541,7 @@ Note that you will likely need to subscribe/unsubscribe to changes in order to t Example: ```js -import React, { useContext } from 'react'; +import React, { useContext, useEffect } from 'react'; import { CarouselContext } from 'pure-react-carousel'; export function MyComponentUsingContext() { diff --git a/typings/index.d.ts b/typings/index.d.ts index d23b863c..9c698efb 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -59,11 +59,11 @@ interface CarouselStoreInterface { readonly subscribe: (func: () => void) => void readonly unsubscribe: (func: () => void) => void readonly updateSubscribers: (cb?: (state: CarouselState) => void) => void - readonly subscribeMasterSpinner: (src) => void - readonly unsubscribeMasterSpinner: (src) => false | object + readonly subscribeMasterSpinner: (src: string) => void + readonly unsubscribeMasterSpinner: (src: string) => false | object readonly unsubscribeAllMasterSpinner: () => void - readonly masterSpinnerSuccess: (src) => void - readonly masterSpinnerError: (src) => void + readonly masterSpinnerSuccess: (src: string) => void + readonly masterSpinnerError: (src: string) => void readonly setMasterSpinnerFinished: () => void readonly isMasterSpinnerFinished: () => boolean }