Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/idyll-lang/idyll-plugin-url-state
This plugin enables the state of an Idyll article to be serialized/deserialized from the URL's query string.
https://github.com/idyll-lang/idyll-plugin-url-state
Last synced: 14 days ago
JSON representation
This plugin enables the state of an Idyll article to be serialized/deserialized from the URL's query string.
- Host: GitHub
- URL: https://github.com/idyll-lang/idyll-plugin-url-state
- Owner: idyll-lang
- License: mit
- Created: 2018-11-20T21:27:34.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-30T05:09:53.000Z (almost 6 years ago)
- Last Synced: 2024-10-30T00:54:57.749Z (21 days ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# idyll-plugin-url-state
This plugin enables the state of an Idyll article to be serialized/deserialized from the URL's query string.
## Usage
Install this as a dependency:
```
$ npm i --save idyll-plugin-url-state
```This plugin requires being hooked into Idyll's context API. To do this, first you need to tell Idyll to use a custom context.
*In package.json*
```json
"idyll": {
"context": "./context.js"
}
```If you aren't using any other context plugins, your `context.js` file would look like this:
```js
const URLState = require('idyll-plugin-url-state');// All keys
module.exports = URLState();// Only certain keys
module.exports = URLState(['key1', 'key2', ...]);
```If you are, you can use `idyll-context-compose` to compose multiple contexts together:
```js
const compose = require('idyll-context-compose');
const URLState = require('idyll-plugin-url-state');module.exports = compose(URLState(), otherContext);
```