react-reducer-provider
Version:
Asynchronous/Synchronous React Centralized State with Hooks and HOC
11 lines (8 loc) • 328 B
JavaScript
// Copyright (c) 2020 Gonzalo Müller Bravo.
// Licensed under the MIT License (MIT), see LICENSE.txt
import * as React from 'react'
import { captureProvider } from './Providers'
export function useAny(id) {
// Must `useContext` since it provides React triggering mechanism,
return React.useContext(captureProvider(id))
}