Ractive Ez Search Sync
Href search synchronizer - keeps the url search in sync with a ractive object.
Install
npm i ractive-ez-searchsync
;
Usage
search
: Simple key => value object that contains the query parametersmapper
: Object that maps a key to a { parse, stringify } object to map between a javascript object and an url query stringmode
:push
to use history.pushState,replace
to use history.replaceStatedefer
: When initially loading the component, the current location query will be used to populate the search object. Use defer to disable this behaviour.
; { return search: name: "John" active: true born: age: 87 password: "secret" labels: "Male" "Tall" "Old" mapper: name: mapperstring active: mapperboolean born: mapperdate age: mappernumber // password: omitted, will not be synchronized labels: string array };