Making Queueables

Into

Ourthings comes with a default set of queueables but inevitably you need to write some functions to perform specific actions. It will be tempting to just embed javascript in the page as you normally would but this should be avoided as it defeats the core principals of the framework

Creating a queueable is simple, lets write a print function

import Queueable from "@nautoguide/ourthings/Queueable";
class MyThing extends Queueable {
    print(pid,json) {
        window.print();
        this.finished(pid, this.queue.DEFINE.FIN_OK);
    }
}

export default Digital;

Now in your build add in your custom queueable

import MyThing from './MyThing';
queue = new Queue({
		"templates": Templates,
		"elements": Elements,
		"mything":"MyThing"
	});

Build your webpack and you can now access your queueable like you would built ins

<button class="option-control" @digital.print();>
    <span class="option-print">Print</span>
</button>