Feat(Sellout): Base app

This commit is contained in:
chip committed 2020-10-10 22:20:03 +02:00
1 parent 9e09ce8879
commit 2112bb5555
13 files changed
+307

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
import { atom } from 'recoil';
export const selloutState = {
listing: atom({
key: 'listing',
default: null
})
}
@@ -0,0 +1,7 @@
import { useRecoilValue } from 'recoil';
import { selloutState } from './state';
export const useListing = () => {
const listing = useRecoilValue(selloutState.listing);
return { listing };
}
@@ -0,0 +1,10 @@
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { selloutState } from './state';
import { useListing } from './useListing';
import { useSetRecoilState } from 'recoil';
export const useSelloutService = () => {
const setSellout = useSetRecoilState(selloutState.listing);
useNuiEvent('SELLOUT', 'setListings', setSellout);
return useListing()
}