1.0.5 • Published 5 years ago

@wox/history v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@wox / history

浏览器history模型,用来处理通用的hashchangepopstate的模式。

Install

npm i @wox/history

Usage

它有2个模式,我们根据需要选择其中一种即可。

import { hashChange, popState } from '@wox/history';

createServer

创建一个基于web的服务。

import { hashChange } from '@wox/history';
const history = new hashChange();
history.createServer((req, res) => {
  // req: request 请求对象
  // res: response 输出对象
});

listen

监听web服务的history变化

import { hashChange } from '@wox/history';
const history = new hashChange();
history.createServer((req, res) => {
  // req: request 请求对象
  // res: response 输出对象
  console.log(req);
}).listen();
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago