SArray
Convenient array signals for S.js.
SArray adds utility methods to S signals carrying arrays. These utility methods parallel the standard ES3/5/6 array methods.
// transformations without SArrayvar arr = Sdata1 2 3 mapped = filtered = ; // transformations with SArrayvar arr = mapped = arr // arr() now has array methods filtered = arr; // mutations without SArrayvar tmp = S;tmp;; // mutations with SArrayarr; // SArray methods also return SArraysvar mappedAndFiltered = arr; // Any array-carrying signal can be 'lifted' to create an SArrayvar plain = Sdata1 2 3 arr = SArray mapped = arr; // etc // When an array signal changes, map() will re-use prior computations// for new items that === the old.var rands = arr;; // ["0.83", "0.75", "0.77"]arr;; // ["0.83", "0.75", "0.77", "0.25"] unchanged values reused
For a full list of methods and thier signatures, consult index.d.ts.