The assign function triggers Mahalo's change detection. Howeverwhen writing your application in TypeScript you don't have to takecare of this yourself and won't need to use this function at all.
In the following examples you can see different assignments an theircounterparts using assign.
let foo = 0;let bar = 0;let baz = {x: 0};// Variable assignments are just wrapped++foo; // 1assign(++foo); // 2foo + (bar = 10); // bar 12foo + assign(bar = 10); // 12// Member assignments must be explicitfoo + baz.x++; // 2foo + assign(baz, 'x', baz.x + 1); // 3
This module exports the assign function that is responsible forchange detection.