Cycle-History
A cycle.js driver built on history. A part of your overall routing solution.
To finish the routing cycle I highly recommend switch-path, or you can provide your own.
Installation
npm install cycle-history
Usage
For more concrete examples on usage, please check out cycle-starter
Client-Side
Define with your other drivers
//import;; // Defined with your driversHistory: // Use in Main - shown in conjunction with switch-path { const pathValue$ = History; const url$ = DOM // filterLinks will make sure this is a path we want to handle // Best to provide more precise selectors to avoid this need. return ... History: url$ }
Server-Side
Following @staltz isomorphic example
// server.js// Lines 27-37 become { return { let requests = ; let wrappedVTree$ = RxObservable; return DOM: wrappedVTree$ History: requestsHistory ; };}// Lines 71-74 becomelet requests responses = Cycle;
makeServerHistoryDriver()
accepts all options allowed in a Location as well as the extra options provided by BasenameSupport and QuerySupport, each respectively can be found here and here. Simple defaults are provided if not supplied.
In @staltz isomorphic example, you can remove all references to context$ if it is now unneeded for your application.