mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-24 20:18:34 +00:00
cache gist by default for faster eval
This commit is contained in:
parent
774c02afab
commit
ecd93c9a92
@ -6,7 +6,7 @@ This program is free software: you can redistribute it and/or modify it under th
|
|||||||
|
|
||||||
// this is a shortcut to eval code from a gist
|
// this is a shortcut to eval code from a gist
|
||||||
// why? to be able to shorten strudel code + e.g. be able to change instruments after links have been generated
|
// why? to be able to shorten strudel code + e.g. be able to change instruments after links have been generated
|
||||||
export default (route) =>
|
export default (route, cache = true) =>
|
||||||
fetch(`https://gist.githubusercontent.com/${route}?cachebust=${Date.now()}`)
|
fetch(`https://gist.githubusercontent.com/${route}?cachebust=${cache ? '' : Date.now()}`)
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((code) => eval(code));
|
.then((code) => eval(code));
|
||||||
|
|||||||
@ -15,5 +15,5 @@ export * from './state.mjs';
|
|||||||
export * from './timespan.mjs';
|
export * from './timespan.mjs';
|
||||||
export * from './util.mjs';
|
export * from './util.mjs';
|
||||||
export * from './speak.mjs';
|
export * from './speak.mjs';
|
||||||
export * as gist from './gist.js';
|
export { default as gist } from './gist.js';
|
||||||
// export * from './value.mjs';
|
// export * from './value.mjs';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user