@whatsup/browser-pathname
TypeScript icon, indicating that this package has built-in type declarations

0.5.2 • Public • Published

Browser pathname cause stream

GitHub Workflow Status (branch) travis codecov language license

Install

npm i @whatsup/browser-pathname
# or
yarn add @whatsup/browser-pathname

Usage

import { fractal } from 'whatsup'
import { render } from '@whatsup/jsx'
import { pathname, redirect } from '@whatsup/browser-pathname'

const app = fractal(function* () {
    while (true) {
        switch (yield* pathname) {
            case '/':
                yield <a onClick={() => redirect('/test')}>Go to test page</a>
                continue
            case '/test':
                yield <a onClick={() => redirect('/')}>Go to home page</a>
                continue
        }
    }
})

render(app)

Readme

Keywords

none

Package Sidebar

Install

npm i @whatsup/browser-pathname

Weekly Downloads

3

Version

0.5.2

License

MIT

Unpacked Size

8.43 kB

Total Files

13

Last publish

Collaborators

  • iminside