Skip to content

Conversation

@BlooJeans
Copy link
Contributor

@BlooJeans BlooJeans commented Nov 14, 2016

Read the in-depth commit descriptions for 31ca65b and 95bfff4 for an overview of the listener changes.

Adds flow to database related javascript files
Fixes storage on android

Also fixes problems arising from:
28644a6: broke the global context, so things like WebSocket and window.navigator weren't getting set correctly
1111617: accidentally introduced a typo in FirestackAuth.java

…o modifiers Previously: db.ref('/messages').on('child_added') db.ref('/messages').limitToFirst(1).on('child_added') db.ref('/messages').limitToLast(1).on('child_added') would add native listeners for the appropiarate queries, but when ANY of the three fired a child_added, than ALL three would receive it e.g. the limitToFirst child_added would get called when the *last* element changed We now keep track of the listeners by path as well as modifierString, and to a lesser extent, by eventType
…eferences with modifiers Everytime you add a modifier (e.g. limitToLast) or change the reference (e.g. child()), you make a new immutable reference/query. This is necessary so that when it comes time to .off()ing your listeners, you can call off on the exact reference/query that you subscribed to. Note that two references or two querys with the same information are NOT the same. This *could* be changed in the future to better align with firebase. let base = firestack.reference('/messages'); base.on('child_added', this.onChildAdded); base.on('child_changed', this.onChildChanged); let newMessages = base.startAt('1'); newMessages.on('child_added', this.onNewMessagesAdded); newMessages.off('child_added', this.onNewMessagesAdded); let latestMessage1 = base.limitToLast(1); latestMessage1.on('child_added', this.onLastMessage1); latestMessage1.off('child_added', this.onLastMessage1); let latestMessage2 = base.limitToLast(1); // *NOT* the same as latestMessage1 latestMessage2.on('child_added', this.onLastMessage2); latestMessage2.off('child_added', this.onLastMessage2); base.off('child_added', this.onChildAdded); base.off('child_changed', this.onChildChanged);
Salakar added a commit to Salakar/react-native-firestack that referenced this pull request Nov 15, 2016
…anup though, unused variables & functions, duplications, unused imports, unnecessary variable creations etc - added TODO notes for everything else that needs cleaning up here
blumanski pushed a commit to blumanski/react-native-firestack-google-signin-hints that referenced this pull request Nov 16, 2016
Google Sign in with Firebase https://github.com/fullstackreact/react-native-firestack https://github.com/devfd/react-native-google-signin 17/11/2016 As both modules are a work in progress, this example worked for me. You may notice that I did not use "firestack.auth.listenForAuth" to listen to the auth changes. Well, I found that slow and kind of out of sync. This pull request: fullstackreact/react-native-firestack#132 fixed few things and the "signInWithProvider" is now responding with the correct user object. Anyway, for future reference...
@Salakar
Copy link
Collaborator

Salakar commented Nov 18, 2016

Implemented on my branch. (Just making a note)

chrisbianca added a commit to Salakar/react-native-firestack that referenced this pull request Nov 18, 2016
auser added a commit that referenced this pull request Jan 4, 2017
…stack into v3 * 'master' of https://github.com/Salakar/react-native-firestack: Update README.md Update authentication.md Update authentication.md Update authentication.md Create remote-config.md Update README.md Fix missing promisify in disconnect.js, add flow Fix Disconnect not being referenced in reference.js Update README.md Merge iOS database changes from #132
@Salakar Salakar closed this Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants