open-index/open-npm huggingface dataset:
npm package: @gsmeira/nuxt-basic-auth
Description: Simple and flexible http authentication for Nuxt 3 apps
Latest version: 0.0.3

# Nuxt Basic Auth

![image](https://github.com/gsmeira/nuxt-basic-auth/assets/1690400/0e6ba951-a7e1-4bd0-adaa-21a0a4d9f5de)

## Instalation

```
pnpm install @gsmeira/nuxt-basic-auth
```

## Usage

...
npm package: @gsmlg/history
Description: history, change with browser history
Latest version: 0.2.9
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# history

``` javascript
import { createHisotry } from '@gsmlg/history';
const history = createHistroy();
history.start();

history.subscirbe((location) => {
  location === '/wasabi';
});

history.push('/wasabi');

```
npm package: @gsmlg/react-redux-router
Description: react redux router
Latest version: 0.2.10

# React-Redux-Router

## RouteProvider
provide `router` context
``` javascript
      <Provider store={store}>
        <RouteProvider history={history}>
          <Switch>
            <Route path="/test" children={(...args) => { spy(args); return null; }} />
            <Redirect to="/test" />
          </Switch>
        </RouteProvider>
      </Provider>
```

## Switch
`Switch` only the first match child will be render
``` javascript
      <Provider store={store}>
        <RouteProvider history={history}>
          <Switch>
            <Route path="/test" children={(...args) => { spy(args); return null; }} />
            <Redirect to="/test" />
          </Switch>
        </RouteProvider>
      </Provider>

```

## Route
`path` if match path, then render `component` or `children`
``` javascript
      <Provider store={store}>
        <RouteProvider history={history}>
          <Switch>
            <Route path="/test" children={(...args) => { spy(args); return null; }} />
            <Redirect to="/test" />
          </Switch>
        </RouteProvider>
      </Provider>

```

## Redirect
* `from`: if match, redirct to `to`
* `to`: redirect to location 
``` javascript
      <Provider store={store}>
        <RouteProvider history={history}>
          <Switch>
            <Route path="/test" children={(...args) => { spy(args); return null; }} />
            <Redirect to="/test" />
          </Switch>
        </RouteProvider>
      </Provider>

```

## middleware

``` javascript
    history = createHistory(MEMO_MODE);
    store = createStore(
      combineReducers({router: routerReducer, spy: (st, act) => { reducerSpy(act); return {}; }}),
      applyMiddleware(routerMiddleware(history))
    );

```

## push

``` javascript
push.setDispatch(store.dispatch);
push('/users')
// or 
store.dispatch(push('/names'))
```

## Link

``` javascript
<Link to="/views" component={<Menu />} />
```

## routeReducer
route Reducer will produce location changes
**TODO** add `match` state in reducer
``` javascript
    history = createHistory(MEMO_MODE);
    store = createStore(
      combineReducers({router: routerReducer, spy: (st, act) => { reducerSpy(act); return {}; }}),
      applyMiddleware(routerMiddleware(history))
    );

```