GartorwareCorp / firebase-util

An experimental toolset for Firebase
http://firebase.github.io/firebase-util
MIT License
8 stars 9 forks source link

s.key is not a function error #11

Closed nurfgun closed 7 years ago

nurfgun commented 7 years ago
screen shot 2016-10-17 at 11 50 51 pm
FIREBASE WARNING: Exception was thrown by user callback. TypeError: s.key is not a function
    at http://localhost:8888/schoolbelle-board/bower_components/firebase-util/dist/firebase-util.js:1876:16

I was using Scroll with Normalized collection.

  hasChild: function(snaps, key) {
    return util.contains(snaps, function(s) {
      return s.key() === key;
    });
  },

  getChildSnaps: function(snapsArray, recordId) {
    return util.filter(snapsArray, function(s) {
      return s.key() === recordId;
    });
  },

should it be changed to 's.key' without parenthesis?

ps. thanks for your effort! I'm benefiting greatly from your work 👍

gartorware commented 7 years ago

Yeah! Now the key is retrieved as a property instead of a function. Remove the parenthesis s.key === key , it should work!

Regards!