Skip to content

Commit

Permalink
clean unuse file
Browse files Browse the repository at this point in the history
  • Loading branch information
HillLiu committed Jan 8, 2022
1 parent 1c3e61b commit c375e6e
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 106 deletions.
19 changes: 0 additions & 19 deletions packages/reshow-flux/src/ReduceStore.js

This file was deleted.

34 changes: 0 additions & 34 deletions packages/reshow-flux/src/__tests__/FluxReduceStoreTest.js

This file was deleted.

26 changes: 0 additions & 26 deletions packages/reshow-flux/src/__tests__/immutableTest.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/reshow-flux/src/getStore.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import callfunc from "call-func";
import get from "get-object-value";

const storeLocator = (props) => props?.store || get(props, ["stores", 0]);
const storeLocator = (props) => props?.store;

const getStore = ({ props, options }) => {
const allProps = { ...options, ...props };
Expand Down
2 changes: 0 additions & 2 deletions packages/reshow-flux/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export { default as useConnect } from "./useConnect";
export { default as ReduceStore } from "./ReduceStore";
export {
default as ImmutableStore,
Map,
Set,
mergeMap,
} from "./ImmutableStore";
export { default as getStore } from "./getStore";
export { Dispatcher } from "reshow-flux-base";
5 changes: 2 additions & 3 deletions packages/reshow-flux/src/useConnect.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useState, useEffect, useDebugValue } from "react";
import { useMounted } from "reshow-hooks";
import { T_TRUE } from "reshow-constant";
import { CHANGE } from "reshow-flux-base";

import getStore from "./getStore";

Expand Down Expand Up @@ -60,9 +59,9 @@ const useConnect =
if (!data.__init__ || data.props !== props) {
handleChange();
}
store.addListener(handleChange, CHANGE);
store.addListener(handleChange);
return () => {
store.removeListener(handleChange, CHANGE);
store.removeListener(handleChange);
};
},
props.changeable ? [props] : []
Expand Down
9 changes: 6 additions & 3 deletions packages/reshow-return/src/connectOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ const getMapIn = (map, path) =>

const reset = (props, more) => {
const nextProps = { ...props };
[
const cleanKeys = [
"immutable",
"initStates",
"pathStates",
"store",
"stores",
"storeLocator",
...(more || []),
].forEach((key) => delete nextProps[key]);
];
let i = cleanKeys.length;
while (i--) {
delete nextProps[cleanKeys[i]];
}
return nextProps;
};

Expand Down
37 changes: 19 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2653,9 +2653,9 @@ camelcase@^6.0.0:
integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==

caniuse-lite@^1.0.30001286:
version "1.0.30001297"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001297.tgz#ea7776ccc4992956582cae5b8fea127fbebde430"
integrity sha512-6bbIbowYG8vFs/Lk4hU9jFt7NknGDleVAciK916tp6ft1j+D//ZwwL6LbF1wXMQ32DMSjeuUV8suhh6dlmFjcA==
version "1.0.30001298"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001298.tgz#0e690039f62e91c3ea581673d716890512e7ec52"
integrity sha512-AcKqikjMLlvghZL/vfTHorlQsLDhGRalYf1+GmWCf5SCMziSGjRYQW/JEksj14NaYHIR6KIhrFAy0HV5C25UzQ==

caseless@~0.12.0:
version "0.12.0"
Expand Down Expand Up @@ -3397,9 +3397,9 @@ duplexer@^0.1.1:
integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==

easing-lib@*:
version "0.1.2"
resolved "https://registry.yarnpkg.com/easing-lib/-/easing-lib-0.1.2.tgz#edd346da7d5a276da129f517c195e7c03ff85600"
integrity sha512-Y+Iz2qLd8fyEy0xWK9WLT3Hqp5kWiuvBUl1D+3soPLfSYhHVDvkHFwjbvzxs86SODx1kQvX4rGjmyKo52ttlkA==
version "0.1.3"
resolved "https://registry.yarnpkg.com/easing-lib/-/easing-lib-0.1.3.tgz#d457411c362968e16abd47739b2c6f96cfefea7a"
integrity sha512-fMbumKX3yvTKG/LIk4jlpp6KAfKG3HTR9OiZkAXS69vAxUUD3t6RdQoaryZnTX6QTlCad/Sl0f/RghkH/+td7w==
dependencies:
call-func "*"
win-doc "*"
Expand Down Expand Up @@ -6184,9 +6184,9 @@ optionator@^0.9.1:
word-wrap "^1.2.3"

organism-react-ajax@*:
version "0.14.17"
resolved "https://registry.yarnpkg.com/organism-react-ajax/-/organism-react-ajax-0.14.17.tgz#0e3d4e31d6d4b0babc95e8fda460cf16d504c9df"
integrity sha512-KjEowxdF2oy5Z+w4YHivnJKiK1jYnt9sPCDx1bgpUEycX2siba3zIFDZs9tR28Tydq78TFtEzKhJCz821mAvDg==
version "0.15.2"
resolved "https://registry.yarnpkg.com/organism-react-ajax/-/organism-react-ajax-0.15.2.tgz#dc35111f3b8b66414583f1d1ff1cf1daf5b0f845"
integrity sha512-9JRp0+sLjZrmCrQZlQzEtyiLeXaLVkx9jeD0BOJFQofmHB+mh04t4IsA0Zt4Hf7iweLiALTf5RnsIc19R21NfQ==
dependencies:
call-func "*"
es6-promise "4.2.5"
Expand Down Expand Up @@ -7152,18 +7152,18 @@ reshow-constant@*, reshow-constant@^0.15.0:
integrity sha512-UxXIt88+ld5EVKsCy8pyT7JkqM1GTbi/JtEVrtLk9CoreW8VijbG4q/RNDpUfFK5FTOO0UQhXPYpodUH0vGEZQ==

reshow-flux-base@*:
version "0.15.8"
resolved "https://registry.yarnpkg.com/reshow-flux-base/-/reshow-flux-base-0.15.8.tgz#34fd6896067c7acf5aaa9376a369fdd6e0228b4f"
integrity sha512-jiUZx2wdHp/MyLN3tPjEE6WudbrlT53pJAimWuKBCnKlLW1I7Hjgp1rGheF9CwKuuuAPtZ1aSdSTLgziR1bhdg==
version "0.15.10"
resolved "https://registry.yarnpkg.com/reshow-flux-base/-/reshow-flux-base-0.15.10.tgz#dc0bc2b77ca6d564b9a6adaff104323dde2be74b"
integrity sha512-BqgYSB076kLgPIhk7ook1UKDAYb5gDThJ2wPpU+1dBGGgV1D/3hxxpuz/wJSfKggkjho6phLd9hZfPxKExHCZg==
dependencies:
call-func "*"
reshow-constant "^0.15.0"
reshow-runtime "*"

reshow-flux@*, reshow-flux@^0.15.0:
version "0.15.10"
resolved "https://registry.yarnpkg.com/reshow-flux/-/reshow-flux-0.15.10.tgz#4d40fac79238eae11c982c4e496a72f285efa194"
integrity sha512-kIdL3WB6FDDXjWbudyszy7RllG2ywS2/QZgb1A39FallPzkOU5b7bStgK1T+/wEIHjr785El+od0WfxznTvtJw==
version "0.15.12"
resolved "https://registry.yarnpkg.com/reshow-flux/-/reshow-flux-0.15.12.tgz#3fde0c58b1116405e4e082825f86910d77876705"
integrity sha512-+MDb9NMu5blqI+a+to+BH/Ggl4bm9WkqQsEgqVR1IyMYQ+lHBd93+aCyMs9x1WrkOyqpCEaFInPJEf8Q0kpbdA==
dependencies:
array.dedup "*"
array.merge "*"
Expand Down Expand Up @@ -7532,10 +7532,11 @@ smart-buffer@^4.1.0:
integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==

smooth-scroll-to@*:
version "0.3.3"
resolved "https://registry.yarnpkg.com/smooth-scroll-to/-/smooth-scroll-to-0.3.3.tgz#9e963bc4f96c84919b7841b1aadc313901a755a1"
integrity sha512-748v8L2hzIEOFQ9eCoXKT/0iGRWQbf1ZNj0W94KaxGDT5W7ssn173CvjjILRMAcD4NO8ccjijiHd3E9PeXtoJw==
version "0.3.4"
resolved "https://registry.yarnpkg.com/smooth-scroll-to/-/smooth-scroll-to-0.3.4.tgz#34f8e765902483eb6064d6941d832ad989a9b49e"
integrity sha512-YVV8c/pbCZCH2Km7aaQdVE1M2ipTWbdXR9ifAAkVpbkhfFfBYwCTlQMdJlrpmeYxJtgT54DLLLlqU+MdEWjF+A==
dependencies:
call-func "*"
easing-lib "*"
get-scroll-info "*"

Expand Down

0 comments on commit c375e6e

Please sign in to comment.