How to use the @reactorx/core.useSelector function in @reactorx/core

To help you get started, we’ve selected a few @reactorx/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github querycap / reactorx / @reactorx / request / src / __tests__ / useRequesting$.spec.tsx View on Github external
function Loading() {
      const requesting$ = useRequesting$();
      const loading = useSelector(requesting$);
      return <span id="{&quot;loading&quot;}">{`${loading}`}</span>;
    }
github querycap / reactorx / @reactorx / form / src / Field.tsx View on Github external
export const useFieldState = (name: string): IFieldState & { name: string; value: any } => {
  const { state$ } = useForm();

  return useSelector(
    state$,
    (state) => ({
      ...get(state, ["fields", name]),
      value: get(state, `values.${name}`),
      name,
    }),
    [name],
  );
};