hop

[Deprecated] Navigation and routing helpers for single page applications in Elm

  • 所有者: sporto/hop
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Hop: Navigation and routing helpers for Elm SPAs

Build Status

alt Hop

With the release of Elm 0.18 the official libraries Navigation and UrlParser have become a lot more robust and useful. They now integrate a lot of the functionality that Hop used to provide for previous versions of Elm. For example UrlParser now has parseHash and parsePath. Because of this I'm not convinced that Hop needs to be upgraded to Elm 0.18. I'll wait and see if this library could provide value in 0.18.

Hop is a helper library meant to be used with:

  • Navigation v1 for listening to location changes in the browser and pushing changes to it.
  • UrlParser v1 for constructing routes and parsing URLs.

What Hop provides

On top of these two packages above, Hop helps with:

  • Abstracting the differences between push or hash routing
  • Providing helpers for working with the query string
  • Encode / Decode the location path
  • Encode / Decode the query string

Getting Started

Please see this example app. It explains how to wire everything in the comments.

Docs

Building routes

Nesting routes

Matching routes

Reverse routing

API

Changelog

Testing Hop

More docs

Upgrade guide 5 to 6

Upgrade guide 4 to 5

Upgrade guide 3 to 4

Upgrade guide 2.1 to 3.0

Version 5 documentation

Version 4 documentation

Version 3 documentation

Version 2 documentation

Hash routing

A proper url should have the query before the hash e.g. ?keyword=Ja#/users/1,
but when using hash routing, query parameters are appended after the hash path e.g. #/users/1?keyword=Ja.
This is done for aesthetics and so the router is fully controlled by the hash fragment.

Examples

See examples/basic and examples/full folders. To run the example apps:

  • Clone this repo
  • Go to example folder
  • Follow the readme in that folder

主要指標

概覽
名稱與所有者sporto/hop
主編程語言Elm
編程語言Elm (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2015-11-20 21:25:44
推送於2017-08-14 14:05:12
最后一次提交2016-11-15 08:31:27
發布數20
最新版本名稱6.0.1 (發布於 2016-10-26 15:56:49)
第一版名稱1.0.0 (發布於 2015-12-17 19:39:23)
用户参与
星數294
關注者數14
派生數21
提交數496
已啟用問題?
問題數35
打開的問題數4
拉請求數10
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?