import { useContext } from 'react';

/**
 * @title: 使用状态管理器的自定义钩子函数
 * @description: 
 * @param {useMyContext} MyContext
 * @return {*}
 * @Author: zhiwei.Wang
 * @Date: 2023-07-05 10:23
 */
var useSharedState = function useSharedState(MyContext) {
  var context = useContext(MyContext);
  if (!context) {
    throw new Error('useMyContext must be used within a MyStateProvider');
  }
  return context;
};
export default useSharedState;