import { Effects, get } from '@typed/effects' import { HistoryEnv, Path } from './types' /** * Push state to history environment * @param data: A * @param path: Path * @returns Effects, A> */ export function* pushState(data: A, path: Path): Effects, A> { const { history } = yield* get>() history.pushState(data, '', path) return data } export function* pushPath(path: Path): Effects { yield* pushState(null, path) }