Closed neocotic closed 7 years ago
Add a set method to allow multiple properties to be set at once, but with a single re-render. Given the following example:
set
const qr = new QRious({ element: document.querySelector('canvas'), value: 'https://github.com/neocotic/qrious' })
If you wanted to change the colours and value, QRious would re-render the QR code 3 times:
qr.background = '#ff0000' qr.foreground = '#0000ff' qr.value = 'QRious'
However, with this proposed change, these properties could be changed in a single call and result in a single re-render:
qr.set({ background: '#ff0000', foreground: '#0000ff', value: 'QRious' })
This should also be documented as well though while also explicitly mentioning that the QR code is re-rendered each time a property is changed.
As a result of implementing this, QRious.DEFAULTS will be deprecated and scheduled for removal in the next major release (e.g 3.0.0).
QRious.DEFAULTS
These changes will be included in the 2.3.0 release.
Add a
set
method to allow multiple properties to be set at once, but with a single re-render. Given the following example:If you wanted to change the colours and value, QRious would re-render the QR code 3 times:
However, with this proposed change, these properties could be changed in a single call and result in a single re-render:
This should also be documented as well though while also explicitly mentioning that the QR code is re-rendered each time a property is changed.