thingsdb / ThingsDB

Node - The ThingsDB Core
https://thingsdb.io
GNU General Public License v3.0
41 stars 3 forks source link

Add `nse(..)` function #333

Closed joente closed 1 year ago

joente commented 1 year ago

Description

Sometimes ThingsDB will generate a change while you know it is not required. A common example is the following:

response = {};
response.test = "message";  // this will create a change as ThingsDB doesn't know that response is not stored
response;

We know that ThingsDB does not require a change, however one will be created. With the new function nse() we could promise ThingsDB that no change is required. The function nse() will only work for chained function calls and assignments. Therefore calling wse() will create a change and will make a call to nse() obsolete. The nse() function should raise an error in the latter case as the usage is not legit.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Checklist: