Files
2025-02-26 14:49:25 +07:00

95 lines
3.3 KiB
JavaScript

//////////////////////////////////////////////////////////////////////////
// //
// This is a generated file. You can view the original //
// source in your browser if your browser supports source maps. //
// Source maps are supported by all recent versions of Chrome, Safari, //
// and Firefox, and by Internet Explorer 11. //
// //
//////////////////////////////////////////////////////////////////////////
(function () {
/* Imports */
var Meteor = Package.meteor.Meteor;
var global = Package.meteor.global;
var meteorEnv = Package.meteor.meteorEnv;
var _ = Package.underscore._;
var ReactiveDict = Package['reactive-dict'].ReactiveDict;
var EJSON = Package.ejson.EJSON;
/* Package-scope variables */
var Session;
(function(){
/////////////////////////////////////////////////////////////////////////////////
// //
// packages/session/session.js //
// //
/////////////////////////////////////////////////////////////////////////////////
//
Session = new ReactiveDict('session');
// Documentation here is really awkward because the methods are defined
// elsewhere
/**
* @memberOf Session
* @method set
* @summary Set a variable in the session. Notify any listeners that the value
* has changed (eg: redraw templates, and rerun any
* [`Tracker.autorun`](#tracker_autorun) computations, that called
* [`Session.get`](#session_get) on this `key`.)
* @locus Client
* @param {String} key The key to set, eg, `selectedItem`
* @param {EJSONable | undefined} value The new value for `key`
*/
/**
* @memberOf Session
* @method setDefault
* @summary Set a variable in the session if it hasn't been set before.
* Otherwise works exactly the same as [`Session.set`](#session_set).
* @locus Client
* @param {String} key The key to set, eg, `selectedItem`
* @param {EJSONable | undefined} value The new value for `key`
*/
/**
* @memberOf Session
* @method get
* @summary Get the value of a session variable. If inside a [reactive
* computation](#reactivity), invalidate the computation the next time the
* value of the variable is changed by [`Session.set`](#session_set). This
* returns a clone of the session value, so if it's an object or an array,
* mutating the returned value has no effect on the value stored in the
* session.
* @locus Client
* @param {String} key The name of the session variable to return
*/
/**
* @memberOf Session
* @method equals
* @summary Test if a session variable is equal to a value. If inside a
* [reactive computation](#reactivity), invalidate the computation the next
* time the variable changes to or from the value.
* @locus Client
* @param {String} key The name of the session variable to test
* @param {String | Number | Boolean | null | undefined} value The value to
* test against
*/
/////////////////////////////////////////////////////////////////////////////////
}).call(this);
/* Exports */
Package._define("session", {
Session: Session
});
})();