Git Product home page Git Product logo

busser's People

Contributors

codesplinta avatar isocroft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

busser's Issues

Not found

I was unable to locate the package on npm, is it out of npm registry?

Or it's has been removed?

[WIP-FEATURE-REQUEST | v1.x]: usePreviousRoute() hook: Implement for both NextJS and ReactJS

Feature Request

Description / Observed Behavior

There is need to implement a usePreviousRoute() hook that works with both NextJS and ReactJS.

Additional Context

import {
  useLocation
} from "react-router-dom-v5-compat";
import { useRouter } from "next/router";
import { useRef } from "react";

export const usePreviousRoute = () => {
  const isReactRouterDOMRouting = typeof useLocation === "function";
  const useBrowserRouter = isReactRouterDOMRouting ? useLocation : useRouter;
  const router = useBrowserRouter();

  const ref = useRef(null);

  useEffect(() => {
    () => {
       ref.current = router.key ?  router.pathname : router.asPath
     }
  }, [location.key])

  if ("on" in (router.events || {})) {
    router.events.on("routeChangeStart", () => {
      ref.current = router.asPath;
    });
  }

  return ref.current;
};

Request for busser version.

v0.1.2

[WIP-FEATURE-REQUEST | v1.x]: useHistoryRouter() hook: Implement for both NextJS and ReactJS

Feature request

Description / Observed Behavior

There is need to implement a useHistoryRouter() hook that works with both NextJS and ReactJS.

Additional Context

import {
  useHistory
} from "react-router-dom";
import {
  useNavigate
} from "react-router-dom-v5-compat";
import { useRouter } from "next/router";

const useHistoryRouter = () => {
    const isReactRouterDOMRouting = typeof useHistory === "function";
    const useBrowserRouter = isReactRouterDOMRouting ? useHistory : useRouter;
    const router = useBrowserRouter();
    const navigator = typeof useNavigate === "function" ? useNavigate() : null;
    
    return {
      navigateTo (urlPath) {
         if (navigator !== null) {
          return navigate(urlPath)
         } else {
           return router.push(urlPath);
        }
      },
      get pathname () {
         if (Boolean(router.location)) {
            return router.location.pathname;
         } else {
           return router.pathname;
         }
      },
      get state () {
         if (Boolean(router.location)) {
            return router.location.state;
         } else {
           return null;
         }
      },
      get search () {
        if (Boolean(router.location)) {
            const searchParams = new URLSearchParams(
              router.location.search
            );
            return Object.fromEntries(
              searchParams.entries()
            );
         } else {
           return router.query;
         }
      },
      navigateBack () {
         if (typeof router.back === "function") {
           router.back();
         } else {
           router.goBack();
         }
      },
      reload () {
         if (typeof router.reload === "function") {
           return router.reload();
         } else {
           return router.location.reload()
         }
      }
    };
};

Request for busser version.

v0.1.2

Deprecated packages

Bug report

Description / Observed Behavior

package deprecation when installing react-busser

This deprecation has to do with rollup-terser lib

What kind of issues did you encounter with busser?
react-busser

Expected Behavior

All packages used are expected to be compatible in subsequent release

Additional Context

busser latest release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.