This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--set image.repository=redislabs/rejson \ | |
--set image.tag=2.0.6 \ | |
--set master.extraFlags='{--loadmodule,/usr/lib/redis/modules/redisearch.so,--loadmodule,/usr/lib/redis/modules/rejson.so}' \ | |
--set replica.extraFlags='{--loadmodule,/usr/lib/redis/modules/redisearch.so,--loadmodule,/usr/lib/redis/modules/rejson.so}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
helm upgrade NAME_OF_DEPLOYMENT bitnami/redis \ | |
-i --wait --timeout 600s \ | |
-n NAMESPACE \ | |
--set metrics.enabled=true \ | |
--set metrics.serviceMonitor.enabled=true \ | |
--set metrics.serviceMonitor.namespace=monitoring \ | |
--set usePassword={true/false} \ | |
--set architecture=replication \ | |
--set auth.enabled={true/false} \ | |
--set image.repository=redislabs/rejson \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { useRecoilState } from 'recoil'; | |
import { stateComment, stateStars } from '../../../states'; | |
import { StarsPicker } from '../../ui-units'; | |
export const Details = () => { | |
const { id, journey } = useRoutingInfo(); // parse query string | |
const key: IRecoilId = { id, journey }; | |
// best practice (won't cause rendering of the entire component) | |
const starState = stateStars(key); | |
// bad practice (will cause rendering of the entire component) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RecoilState } from 'recoil'; | |
export interface IStarsPickerProps { | |
state: RecoilState<number>; | |
} | |
export const StarsPicker =({ state }: IStarsPickerProps) => { | |
const [value, setValue] = useRecoilState(state); | |
return ( | |
<ReactStars | |
name="raring" | |
value={value} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (guardRecoilDefaultValue(value)) { | |
reset(stateProductId(familyKey)); | |
reset(stateColor(familyKey)); | |
reset(stateSize(familyKey)); | |
reset(stateCount(familyKey)); | |
// remove from tracking | |
set(stateTracking(journey), | |
(prv) => [...prv.filter((m) => m !== id)]); | |
return; // no need for further handling | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set(stateProductId(familyKey), value.productId); | |
set(stateColor(familyKey), value.color); | |
set(stateSize(familyKey), value.size); | |
set(stateCount(familyKey), value.count); | |
// track | |
set(stateTracking(journey), (prv) => { | |
return [...prv, id]; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (guardRecoilDefaultValue(value)) { | |
reset(stateProductId(familyKey)); | |
reset(stateColor(familyKey)); | |
reset(stateSize(familyKey)); | |
reset(stateCount(familyKey)); | |
// remove from tracking | |
set(stateTracking(journey), | |
(prv) => [...prv.filter((m) => m !== id)]); | |
return; // no need for further handling | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DefaultValue } from 'recoil'; | |
export const guardRecoilDefaultValue = ( | |
candidate: any | |
): candidate is DefaultValue => { | |
if (candidate instanceof DefaultValue) return true; | |
return false; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const key: IRecoilId = { | |
id, | |
journey, | |
}; | |
const order = useRecoilValue(stateOrder(key)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const stateOrder = selectorFamily<IOrder, IRecoilId>({ | |
key: 'state-order', | |
get: (familyKey) => ({ get }) => { | |
const { color, size, productId, count } = get( | |
waitForAll({ | |
productId: stateProductId(familyKey), | |
color: stateColor(familyKey), | |
size: stateSize(familyKey), | |
count: stateCount(familyKey), | |
}) |
NewerOlder