Insert script tags in your HTML.
<script src="https://unpkg.com/sush"></script>
<script src="https://unpkg.com/sush-plugin-trim-id"></script>
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/sush"></script>
<script src="https://unpkg.com/sush-plugin-trim-id"></script>
<script>
console.log(location.hash);
var sush = new SUSH();
sush.flow([
({ id, store }) => {
console.log(id);
return { id, store };
},
SUSH.$trimId({ head: 1, tail: 5 })
])
.then(({ id, store }) => {
console.log(id);
})
.catch((err) => {
console.error(err.stack || err);
});
</script>
</head>
</html>
import SUSH from 'sush';
import trimId from 'sush-plugin-trim-id';
console.log(location.hash);
const sush = new SUSH();
sush.flow([
({ id, store }) => {
console.log(id);
return { id, store };
},
trimId({ head: 1, tail: 5 })
])
.then(({ id, store }) => {
console.log(id);
})
.catch((err) => {
console.error(err.stack || err);
});
PRs accepted.