UNPKG

@croquet/react

Version:

React bindings for Croquet

13 lines (12 loc) 332 B
import { useView } from './useView'; /** * Hook that sets up a callback for Croquet.View.update(). * * The function will be called at each simulation cycle. */ export function useUpdateCallback(callback) { const croquetView = useView(); if (croquetView !== null) { croquetView.updateCallback = callback; } }