How to use the mem.set function in mem

To help you get started, we’ve selected a few mem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github artyomtrityak / just-test-it / static / screens / books / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      // Init menu
      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'books');

      // Init books
      this.booksModule = Mem.set('books', BooksModule);
      this.booksModule.showList(this.container.getBooksContainer());

      //Init comments
      this.commentsModule = Mem.set('comments', CommentsModule);
    },
github artyomtrityak / just-test-it / static / screens / books / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      // Init menu
      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'books');

      // Init books
      this.booksModule = Mem.set('books', BooksModule);
      this.booksModule.showList(this.container.getBooksContainer());

      //Init comments
      this.commentsModule = Mem.set('comments', CommentsModule);
    },
github artyomtrityak / just-test-it / static / screens / books / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      // Init menu
      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'books');

      // Init books
      this.booksModule = Mem.set('books', BooksModule);
      this.booksModule.showList(this.container.getBooksContainer());

      //Init comments
      this.commentsModule = Mem.set('comments', CommentsModule);
    },
github artyomtrityak / just-test-it / static / screens / authors / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'authors');
    },
github artyomtrityak / just-test-it / static / screens / authors / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'authors');
    },
github artyomtrityak / just-test-it / static / screens / books / main.js View on Github external
onBeforeRoute: function() {
      // Init main module container
      this.container = Mem.set('container', View, {
        container: $('#wrap')
      });

      // Init menu
      this.menuModule = Mem.set('menu', MenuModule);
      this.menuModule.showMenu(this.container.getMenuContainer(), 'books');

      // Init books
      this.booksModule = Mem.set('books', BooksModule);
      this.booksModule.showList(this.container.getBooksContainer());

      //Init comments
      this.commentsModule = Mem.set('comments', CommentsModule);
    },
github artyomtrityak / just-test-it / static / modules / books / main.js View on Github external
showList: function(container) {
      //Mock.mock();

      this.collection = Mem.set('booksCollection', Collection);
      
      this.collectionView = Mem.set('booksListView', BooksView, {
        container: container,
        collection: this.collection
      });

      if (!this.collection.length) {
        this.collection.fetch({
          success: _.bind(function() {
            this.collectionView.render();    
          }, this)
        });  
      }

      //Mock.respond();
    },
github artyomtrityak / just-test-it / static / modules / menu / main.js View on Github external
showMenu: function(container, active) {
      this.view = Mem.set('menuView', View, {
        container: container,
        active: active
      });
    }    
  });
github artyomtrityak / just-test-it / static / modules / books / main.js View on Github external
showBook: function(container, id) {
      //Mock.mock();

      this.model = Mem.set('bookDetailsModel', Model, {id: id});

      this.bookView = Mem.set('bookDetailsView', BookView, {
        container: container,
        model: this.model,
        isDetails: true
      });

      if (!this.model.isSynced()) {
        this.model.fetch({
          success: _.bind(function() {
            this.bookView.render();
          }, this)
        });
      }

      //Mock.respond();
github artyomtrityak / just-test-it / static / modules / books / main.js View on Github external
showList: function(container) {
      //Mock.mock();

      this.collection = Mem.set('booksCollection', Collection);
      
      this.collectionView = Mem.set('booksListView', BooksView, {
        container: container,
        collection: this.collection
      });

      if (!this.collection.length) {
        this.collection.fetch({
          success: _.bind(function() {
            this.collectionView.render();    
          }, this)
        });  
      }

      //Mock.respond();
    },

mem

Memoize functions - An optimization used to speed up consecutive function calls by caching the result of calls with identical input

MIT
Latest version published 12 months ago

Package Health Score

64 / 100
Full package analysis