@ledvance/base 1.0.10 → 1.0.12
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.
|
@@ -6,7 +6,7 @@ export interface NativeProps {
|
|
|
6
6
|
pId: string;
|
|
7
7
|
dps: any;
|
|
8
8
|
familyName: string;
|
|
9
|
-
timeSchedule
|
|
9
|
+
timeSchedule: symbol;
|
|
10
10
|
}
|
|
11
11
|
declare function simpleSetDps<T>(dispatch: Dispatch<any>): (deviceId: string, dps: any) => Promise<Result<T>>;
|
|
12
12
|
declare function simpleSetDp<T>(dispatch: Dispatch<any>): (deviceId: string, dp: string, value: any) => Promise<Result<T>>;
|
|
@@ -19,7 +19,7 @@ interface DpState {
|
|
|
19
19
|
[dpCode: string]: DpValue;
|
|
20
20
|
}
|
|
21
21
|
declare const useDeviceInfo: () => DevInfo<DpState>;
|
|
22
|
-
declare const useTimeSchedule: () =>
|
|
22
|
+
declare const useTimeSchedule: () => [v: Symbol, f: any];
|
|
23
23
|
export declare const ldvModules: import("@reduxjs/toolkit").Reducer<NativeProps, import("@reduxjs/toolkit").AnyAction>;
|
|
24
24
|
export declare const setNativeProps: import("@reduxjs/toolkit").ActionCreatorWithPayload<NativeProps, string>, setDps: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>, setTimeSchedule: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, string>;
|
|
25
25
|
export { simpleSetDps, simpleSetDp, useDeviceId, useDeviceInfo, useDp, useDps, useFamilyName, useTimeSchedule, };
|
|
@@ -11,7 +11,7 @@ export interface NativeProps {
|
|
|
11
11
|
pId: string,
|
|
12
12
|
dps: any,
|
|
13
13
|
familyName: string,
|
|
14
|
-
timeSchedule
|
|
14
|
+
timeSchedule: symbol;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const initialState: NativeProps = {
|
|
@@ -43,7 +43,7 @@ const nativePropsSlice = createSlice({
|
|
|
43
43
|
})
|
|
44
44
|
},
|
|
45
45
|
setTimeSchedule(state, action: PayloadAction<any>) {
|
|
46
|
-
state.timeSchedule = action.payload
|
|
46
|
+
state.timeSchedule = action.payload
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
})
|
|
@@ -125,8 +125,13 @@ const useDeviceInfo: () => DevInfo<DpState> = () => {
|
|
|
125
125
|
return useSelector(state => state.devInfo)
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const useTimeSchedule = () => {
|
|
129
|
-
|
|
128
|
+
const useTimeSchedule = (): [v:Symbol, f:any] => {
|
|
129
|
+
const dps = useSelector(store => store.ldvModules.timeSchedule)
|
|
130
|
+
const dispatch = useDispatch()
|
|
131
|
+
const setTimeScheduleFn = (value: Symbol) =>{
|
|
132
|
+
dispatch(setTimeSchedule(value))
|
|
133
|
+
}
|
|
134
|
+
return [dps, setTimeScheduleFn]
|
|
130
135
|
}
|
|
131
136
|
|
|
132
137
|
export const ldvModules = nativePropsSlice.reducer
|