Add automatically update the preview

Thanks to @fred-wang to raise this and show how to do it.

Close #11.