I’d probably implement that via a simple tag. Just #save or something. Then, in your project.js, you’d add a new tag handler that runs the save function!
#save
project.js
save