Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@r7kamura/cycle-history-driver

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@r7kamura/cycle-history-driver - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

6

lib/make-history-driver.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.makeHistoryDriver = makeHistoryDriver;
exports['default'] = makeHistoryDriver;

@@ -29,2 +29,4 @@ var _cycleCore = require('@cycle/core');

};
}
}
module.exports = exports['default'];
{
"name": "@r7kamura/cycle-history-driver",
"version": "0.0.1",
"version": "0.0.2",
"description": "A Cycle.js Driver to manage the browser history.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/r7kamura/cycle-history-driver",

@@ -12,2 +12,3 @@ # cycle-history-driver

import Cycle from '@cycle/core';
import { makeDOMDriver } from '@cycle/dom'
import { makeHistoryDriver } from '@r7kamura/cycle-history-driver';

@@ -27,2 +28,3 @@

// In your view function, you need to prepare an Observable that emits Object{url} for push-state.
// This Observable must be returned from your main function.
const historyRecord$ = DOM.select('a.your-internal-anchor').events('click').map((event) => {

@@ -37,3 +39,4 @@ event.preventDefault();

// In your intent function, you can subscribe history to react to pop-state events.
// This Observable can be accessed from your main function's arguments.
history.map(_ => window.location.href).map((url) => { /* ... */ });
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc