v0.54.0
Pre-release
Pre-release
Custom Actions Request
There is a way to override function used to fetch data in novely config.
const engine = novely({
...config,
fetch: async (...args) => {
console.log(args)
return await window.fetch(...args);
}
})That function now is passed to custom actions.
const handler: CustomHandler = async ({ request }) => {
await request('something.json')
};Custom Actions Assets
Custom actions have .assets field, previously it could be only an array, but now it can also be a function.
const handler: CustomHandler = async () => {};
// handler.assets = [url];
handler.assets = async ({ request }) => {
return await request('assets-for-my-action.json').then((r) => r.json())
}When duration of assets function exceeds 250 ms empty array will be used instead of awaiting more. Function will be overwritten, always returning value from first run.