import { useGate } from "effector-solid";

Function for passing data to Gate.

Methods

useGate(Gate, props)

Formulae

useGate(Gate: Gate<Props>, props: Props): void;

Arguments

  1. Gate (Gate<Props>)
  2. props (Props)

Returns

(void)

Examples

Basic Usage

import { createGate, useGate } from "effector-solid";
import { Route, Routes } from "solid-app-router";

const PageGate = createGate("page");

const Home = (props) => {
  useGate(PageGate, props);
  return <section>Home</section>;
};

PageGate.state.watch(({ match }) => {
  console.log(match);
});

const App = () => (
  <Routes>
    <Route element={<Home />} />
  </Routes>
);
Contributors