@azrico/url
TypeScript icon, indicating that this package has built-in type declarations

1.4.26 • Public • Published

@azrico/url

Url handler for react native web

Install

yarn add @azrico/url

Usage

import {goToUrl, updateUrlParameter, PathButton} from "deus-url";
import {UrlChangeHandler, UrlStore} from "deus-url";

class Example extends Component {
    render() {
        return <div>
					<PathButton page="customers"  />
					<PathButton page="vendors" />
					<PathButton page="settings" />
				</div>; //go to this page (set value of page in query string)
    }
}


class Core extends Component {

	//using one UrlChangeHandler at top of your app will let you do this :

	const current_page = UrlStore.useState((s) => s.current_page);//current page (value of page in query string)
    render() {
        return <UrlChangeHandler>{/* rest of the app */}<UrlChangeHandler/>;
    }
}

List of functions

pageUpdated
reloadPage
gotoNewPath
gotoPath
goToUrl
setUrlParameter
setUrlHash
usePath
useUrlHash
getUrlHash
setUrlPath
modifyUrlParameter

License

MIT ©

Readme

Keywords

none

Package Sidebar

Install

npm i @azrico/url

Weekly Downloads

20

Version

1.4.26

License

MIT

Unpacked Size

18.8 kB

Total Files

12

Last publish

Collaborators

  • azrideus