Persist a value to AsyncStorage.
Wrapper around setItem & multiSet.
@param {String, Array} key for value
@param {Any} value to persist
@returns {Promise}
177749
function set (key, value) {
  if (Array.isArray(key)) {
    const items = key.map(([key, value]) => [key, JSON.stringify(value)])
    return AsyncStorage.multiSet(items)
  }

  return AsyncStorage.setItem(key, JSON.stringify(value))
}
776840
function setValue(object, key, value) {
  if (key in object === true) return;
  object[key] = value;
}
955419
function putItem(value) {
  return new Promise((resolve, reject) => {
    return instance.pkgs.then(db => {
      const obj = db.transaction(db.name, 'readwrite')
        .objectStore(db.name);
      const req = obj.put(value);
      req.onerror = event => reject(event);
      req.onsuccess = () => resolve();
    });
  });
}
1284538
public Eval<UploadResult> putAsync(String key, Object value) {
        return Eval.later(() -> put(key, value))
                   .map(t -> t.orElse(null))
                   .map(FluentFunctions.ofChecked(up -> up.waitForUploadResult()));

    }
785409
function set(key, value) {
  const entry = this.get(key, true);
  let oldvalue;
  if (entry) {
    oldvalue = entry.value;
    entry.value = value;
  } else {
    oldvalue = this.put(key, value);
    if (oldvalue) oldvalue = oldvalue.value;
  }
  return oldvalue;
}
621795
function setItem(key, value) {
  storage[key] = typeof value === 'string' ? value : JSON.stringify(value);
}
968042
function set(Key, MaybeValue) {

        flocksLog(3, " - Flocks2 multi-set");

        if (typeof Key === "string")      { return setByKey(Key, MaybeValue); }
        else if (isArray(Key))            { return setByPath(Key, MaybeValue); }
//      else if (isNonArrayObject(Key))   { return setByObject(Key); }              // todo
        else                              { throw "Flocks2 set/1,2 key must be a string or an array"; }

    }
1068955
function(key, value) {
			var store = this._local.store;

			if (value === undefined) {
				return store.get.call(this, key);
			} else if (value === null) {
				store.remove.call(this, key);
			} else {
				store.set.call(this, key, value);
			}
		}
444652
function setItem(key, value) {
    storage[key] = value;
    cookie.setItem('koekje', qs.stringify(storage, prefix));

    koekje.length++;
  }
472588
public void set(String key, String value) {
		cache.put(key, value);
		user.sendGlobal("JWWF-storageSet", "{\"key\":" + Json.escapeString(key) + ",\"value\":" + Json.escapeString(value) + "}");
	}
1050384
function(key, value){
    var c = getCache(this.ns)

    // set({foo: "bar"})
    if(arguments.length === 1 && typeof key === "object") {
      Object.keys(key).forEach(function(k){
        c[k] = key[k]
      }, this)
    }

    // set("foo", "bar")
    else {
      c[key] = value
    }

    return setCache(this.ns, c)
  }
676865
function (key, value) {
      if (!supported) {
        try {
          $cookieStore.set(key, value);
          return value;
        } catch (e) {
          console.log('Local Storage not supported, make sure you have the $cookieStore supported.');
        }
      }
      var saver = JSON.stringify(value);
      storage.setItem(key, saver);
      return privateMethods.parseValue(saver);
    }
289043
function (key, value, dict) {
	    	var deferred = $q.defer();
	    	var promise = deferred.promise;
            
            function ok(value){
                deferred.resolve(value);
            }
            
            function errorCallback(error){
                deferred.reject(new Error(error));
            }
            
            if($window.plugins){
                var storeResult;
                if(arguments.length === 3){
                    storeResult = $window.plugins.appPreferences.store(dict, key, value);
                } else {
                    storeResult = $window.plugins.appPreferences.store(key, value);
                }
                
                storeResult.then(ok, errorCallback);
            } else {
                deferred.reject(new Error(this.pluginNotEnabledMessage));
            }
            
	    	this.decoratePromise(promise);
	    	return promise;
	    }
373520
public function set(string $key, $value): Promise
    {
        return $this->client->xcache->set($key, serialize($value))->otherwise(function () {
            // Ignore
        });
    }
1087912
def put(self, key, value, expire=None, timeout=1, is_async=True, only_read=False):
        
        if key in self.cache_items:
            self.cache_items.pop(key)
        if expire is None:
            expire = self.expire
        self.cache_items[key] = CacheItem(key=key, value=value, expire=expire)
376508
function(key, value) {
		if (value === undefined) {
			return this.remove(key)
		}
		this.storage.write(this._namespacePrefix + key, this._serialize(value))
		return value
	}
569972
function set(key, val){
  return null == val
    ? storage.removeItem(key)
    : storage.setItem(key, JSON.stringify(val));
}