simian 0.2.0

A command-line tool for exploring and implementing Machine Learning algorithms in Rust.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { createContext, useContext } from 'react'

export interface LatexBlockContextValue {
  equationMap: Map<string, number>
}

export const LatexBlockContext = createContext<LatexBlockContextValue>({
  equationMap: new Map(),
})

export function useLatexBlock() {
  return useContext(LatexBlockContext)
}

export const useEquationNumber = (id: string) => {
  const { equationMap } = useLatexBlock()
  return equationMap.get(id) ?? null
}