@fountain-ui/core 2.0.0-beta.17 → 2.0.0-beta.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,6 +23,11 @@ function useIndexStore(value) {
23
23
  animatedValue.removeListener(id);
24
24
  };
25
25
  }, [animatedValue]);
26
+ (0, _react.useEffect)(() => {
27
+ return () => {
28
+ store.removeAllListeners();
29
+ };
30
+ }, [store]);
26
31
  return store;
27
32
  }
28
33
 
@@ -1 +1 @@
1
- {"version":3,"names":["useIndexStore","value","animatedValue","initialValue","store","useRef","SimpleStore","current","useEffect","id","addListener","newIndex","dispatch","removeListener"],"sources":["useIndexStore.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { MonoStore } from '../store';\nimport { SimpleStore } from '../store';\nimport type { SyncAnimatedValue } from '../types';\n\nexport default function useIndexStore(value: SyncAnimatedValue): MonoStore<number> {\n const {\n animatedValue,\n initialValue,\n } = value;\n\n const store = useRef(new SimpleStore(initialValue)).current;\n\n useEffect(() => {\n const id = animatedValue.addListener((newIndex) => {\n store.dispatch(newIndex.value);\n });\n\n return () => {\n animatedValue.removeListener(id);\n };\n }, [animatedValue]);\n\n return store;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAGe,SAASA,aAAT,CAAuBC,KAAvB,EAAoE;EAC/E,MAAM;IACFC,aADE;IAEFC;EAFE,IAGFF,KAHJ;EAKA,MAAMG,KAAK,GAAG,IAAAC,aAAA,EAAO,IAAIC,kBAAJ,CAAgBH,YAAhB,CAAP,EAAsCI,OAApD;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACZ,MAAMC,EAAE,GAAGP,aAAa,CAACQ,WAAd,CAA2BC,QAAD,IAAc;MAC/CP,KAAK,CAACQ,QAAN,CAAeD,QAAQ,CAACV,KAAxB;IACH,CAFU,CAAX;IAIA,OAAO,MAAM;MACTC,aAAa,CAACW,cAAd,CAA6BJ,EAA7B;IACH,CAFD;EAGH,CARD,EAQG,CAACP,aAAD,CARH;EAUA,OAAOE,KAAP;AACH;;AAAA"}
1
+ {"version":3,"names":["useIndexStore","value","animatedValue","initialValue","store","useRef","SimpleStore","current","useEffect","id","addListener","newIndex","dispatch","removeListener","removeAllListeners"],"sources":["useIndexStore.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { MonoStore } from '../store';\nimport { SimpleStore } from '../store';\nimport type { SyncAnimatedValue } from '../types';\n\nexport default function useIndexStore(value: SyncAnimatedValue): MonoStore<number> {\n const {\n animatedValue,\n initialValue,\n } = value;\n\n const store = useRef(new SimpleStore(initialValue)).current;\n\n useEffect(() => {\n const id = animatedValue.addListener((newIndex) => {\n store.dispatch(newIndex.value);\n });\n\n return () => {\n animatedValue.removeListener(id);\n };\n }, [animatedValue]);\n\n useEffect(() => {\n return () => {\n store.removeAllListeners();\n };\n }, [store]);\n\n return store;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAGe,SAASA,aAAT,CAAuBC,KAAvB,EAAoE;EAC/E,MAAM;IACFC,aADE;IAEFC;EAFE,IAGFF,KAHJ;EAKA,MAAMG,KAAK,GAAG,IAAAC,aAAA,EAAO,IAAIC,kBAAJ,CAAgBH,YAAhB,CAAP,EAAsCI,OAApD;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACZ,MAAMC,EAAE,GAAGP,aAAa,CAACQ,WAAd,CAA2BC,QAAD,IAAc;MAC/CP,KAAK,CAACQ,QAAN,CAAeD,QAAQ,CAACV,KAAxB;IACH,CAFU,CAAX;IAIA,OAAO,MAAM;MACTC,aAAa,CAACW,cAAd,CAA6BJ,EAA7B;IACH,CAFD;EAGH,CARD,EAQG,CAACP,aAAD,CARH;EAUA,IAAAM,gBAAA,EAAU,MAAM;IACZ,OAAO,MAAM;MACTJ,KAAK,CAACU,kBAAN;IACH,CAFD;EAGH,CAJD,EAIG,CAACV,KAAD,CAJH;EAMA,OAAOA,KAAP;AACH;;AAAA"}
@@ -14,6 +14,11 @@ export default function useIndexStore(value) {
14
14
  animatedValue.removeListener(id);
15
15
  };
16
16
  }, [animatedValue]);
17
+ useEffect(() => {
18
+ return () => {
19
+ store.removeAllListeners();
20
+ };
21
+ }, [store]);
17
22
  return store;
18
23
  }
19
24
  ;
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useRef","SimpleStore","useIndexStore","value","animatedValue","initialValue","store","current","id","addListener","newIndex","dispatch","removeListener"],"sources":["useIndexStore.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { MonoStore } from '../store';\nimport { SimpleStore } from '../store';\nimport type { SyncAnimatedValue } from '../types';\n\nexport default function useIndexStore(value: SyncAnimatedValue): MonoStore<number> {\n const {\n animatedValue,\n initialValue,\n } = value;\n\n const store = useRef(new SimpleStore(initialValue)).current;\n\n useEffect(() => {\n const id = animatedValue.addListener((newIndex) => {\n store.dispatch(newIndex.value);\n });\n\n return () => {\n animatedValue.removeListener(id);\n };\n }, [animatedValue]);\n\n return store;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,OAAlC;AAEA,SAASC,WAAT,QAA4B,UAA5B;AAGA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAoE;EAC/E,MAAM;IACFC,aADE;IAEFC;EAFE,IAGFF,KAHJ;EAKA,MAAMG,KAAK,GAAGN,MAAM,CAAC,IAAIC,WAAJ,CAAgBI,YAAhB,CAAD,CAAN,CAAsCE,OAApD;EAEAR,SAAS,CAAC,MAAM;IACZ,MAAMS,EAAE,GAAGJ,aAAa,CAACK,WAAd,CAA2BC,QAAD,IAAc;MAC/CJ,KAAK,CAACK,QAAN,CAAeD,QAAQ,CAACP,KAAxB;IACH,CAFU,CAAX;IAIA,OAAO,MAAM;MACTC,aAAa,CAACQ,cAAd,CAA6BJ,EAA7B;IACH,CAFD;EAGH,CARQ,EAQN,CAACJ,aAAD,CARM,CAAT;EAUA,OAAOE,KAAP;AACH;AAAA"}
1
+ {"version":3,"names":["useEffect","useRef","SimpleStore","useIndexStore","value","animatedValue","initialValue","store","current","id","addListener","newIndex","dispatch","removeListener","removeAllListeners"],"sources":["useIndexStore.ts"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport type { MonoStore } from '../store';\nimport { SimpleStore } from '../store';\nimport type { SyncAnimatedValue } from '../types';\n\nexport default function useIndexStore(value: SyncAnimatedValue): MonoStore<number> {\n const {\n animatedValue,\n initialValue,\n } = value;\n\n const store = useRef(new SimpleStore(initialValue)).current;\n\n useEffect(() => {\n const id = animatedValue.addListener((newIndex) => {\n store.dispatch(newIndex.value);\n });\n\n return () => {\n animatedValue.removeListener(id);\n };\n }, [animatedValue]);\n\n useEffect(() => {\n return () => {\n store.removeAllListeners();\n };\n }, [store]);\n\n return store;\n};\n"],"mappings":"AAAA,SAASA,SAAT,EAAoBC,MAApB,QAAkC,OAAlC;AAEA,SAASC,WAAT,QAA4B,UAA5B;AAGA,eAAe,SAASC,aAAT,CAAuBC,KAAvB,EAAoE;EAC/E,MAAM;IACFC,aADE;IAEFC;EAFE,IAGFF,KAHJ;EAKA,MAAMG,KAAK,GAAGN,MAAM,CAAC,IAAIC,WAAJ,CAAgBI,YAAhB,CAAD,CAAN,CAAsCE,OAApD;EAEAR,SAAS,CAAC,MAAM;IACZ,MAAMS,EAAE,GAAGJ,aAAa,CAACK,WAAd,CAA2BC,QAAD,IAAc;MAC/CJ,KAAK,CAACK,QAAN,CAAeD,QAAQ,CAACP,KAAxB;IACH,CAFU,CAAX;IAIA,OAAO,MAAM;MACTC,aAAa,CAACQ,cAAd,CAA6BJ,EAA7B;IACH,CAFD;EAGH,CARQ,EAQN,CAACJ,aAAD,CARM,CAAT;EAUAL,SAAS,CAAC,MAAM;IACZ,OAAO,MAAM;MACTO,KAAK,CAACO,kBAAN;IACH,CAFD;EAGH,CAJQ,EAIN,CAACP,KAAD,CAJM,CAAT;EAMA,OAAOA,KAAP;AACH;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fountain-ui/core",
3
- "version": "2.0.0-beta.17",
3
+ "version": "2.0.0-beta.18",
4
4
  "author": "Fountain-UI Team",
5
5
  "description": "React components that implement Tappytoon's Fountain Design.",
6
6
  "license": "MIT",
@@ -14,8 +14,8 @@
14
14
  "prepare": "bob build"
15
15
  },
16
16
  "dependencies": {
17
- "@fountain-ui/styles": "^2.0.0-beta.7",
18
- "@fountain-ui/utils": "^2.0.0-beta.3"
17
+ "@fountain-ui/styles": "^2.0.0-beta.8",
18
+ "@fountain-ui/utils": "^2.0.0-beta.4"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@react-native-community/slider": "^4.1.6",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "bd0ccbf7db51f1418dffb2da36fe167654a58f7e"
70
+ "gitHead": "9c4af6d69493666d86b7736892f778af775a3c80"
71
71
  }
@@ -21,5 +21,11 @@ export default function useIndexStore(value: SyncAnimatedValue): MonoStore<numbe
21
21
  };
22
22
  }, [animatedValue]);
23
23
 
24
+ useEffect(() => {
25
+ return () => {
26
+ store.removeAllListeners();
27
+ };
28
+ }, [store]);
29
+
24
30
  return store;
25
31
  };