Massive/toast.ts
Brandon Presley 49b5eb48c6 Refactor MassiveSnack
Instead of using a context for the whole app
use DeviceEventEmitter with root state.
This will probably improve performance,
since I think the react context was
re-rendering the entire DOM tree.
2022-11-01 15:55:37 +13:00

8 lines
162 B
TypeScript

import {DeviceEventEmitter} from 'react-native'
export const TOAST = 'toast'
export function toast(value: string) {
DeviceEventEmitter.emit(TOAST, {value})
}