Releases: n6g7/redux-saga-firebase
Releases · n6g7/redux-saga-firebase
v0.7.0
This release includes several breaking changes .
- Firestore! 🔥🏪
- New
sync
API
Updates
- (breaking)
*database.sync(path, options)
now takes anoption
object as argument.
The objects has three keys:successActionCreator
(required): an action creator to dispatch an action on successfailureActionCreator
(optional): an action creator to dispatch an action on failuretransform
(optional): this is used to transform the data received from the database before it is passed to the success action creator.
Thanks, @BrunoGodefroy! 🎉
- (breaking)
*messaging.syncMessages(options)
now takes anoption
object as argument (same as*database.sync(path, options)
). Thanks, @BrunoGodefroy! 🎉 - (breaking)
*messaging.syncToken(options)
now takes anoption
object as argument (same as*database.sync(path, options)
). Thanks, @BrunoGodefroy! 🎉
Additions
*firestore.addDocument(collectionRef, data)
: adds a new document to this collection with the specified data, assigning it a document ID automatically.firestore.channel(pathOrRef, type)
: returns a redux-saga Channel which emits every time the data at pathOrRef in firestore changes.*firestore.deleteDocument(documentRef)
: deletes the document referred to by this DocumentReference.*firestore.getCollection(collectionRef)
: reads the collection referred to by this collectionRef. Thanks, @sarovin! 🎉*firestore.getDocument(docRef)
: reads the document referred to by this documentRef. Thanks, @sarovin! 🎉*firestore.setDocument(docRef, data, options)
: writes to the document referred to by this DocumentReference. If the document does not exist yet, it will be created. If you pass options, the provided data can be merged into the existing document.*firestore.syncCollection(pathOrRef, options)
: automatically dispatches a redux action every time the collection at pathOrRef changes.*firestore.syncDocument(pathOrRef, options)
: automatically dispatches a redux action every time the document at pathOrRef changes.*firestore.updateDocument(docRef, ...args)
: updates fields in the document referred to by this DocumentReference. The update will fail if applied to a document that does not exist.
v0.6.1
Additions
*messaging.syncMessages(actionCreator)
: automatically dispatches a redux action every time a new message is received.
v0.6.0
Simpler messaging token management!
Additions
*messaging.syncToken(actionCreator)
: automatically dispatches a redux action every time a new registration token is received.
v0.5.0
Three new authentication features:
- password reset
- email verification
- password update
Additions
*auth.applyActionCode(code)
: applies a verification code sent to the user by email or other out-of-band mechanism. Thanks, @sarovin! 🎉*auth.confirmPasswordReset(code, newPassword)
: completes the password reset process, given a confirmation code and new password. Thanks, @sarovin! 🎉*auth.sendEmailVerification(actionCodeSettings)
: sends a verification email to a user. Thanks, @sarovin! 🎉*auth.sendPasswordResetEmail(email, actionCodeSettings)
: sends a password reset email to the given email address. Thanks, @sarovin! 🎉*auth.updatePassword(password)
: updates the current user's password. Thanks, @sarovin! 🎉
v0.4.2
Fixes
- Fixed a bug where the
database.sync
method wasn't closing the channel properly.
v0.4.0
v0.3.0
Updates
- All database methods now take a
pathOrRef
argument instead of the previouspath
argument. This new argument can be either a string or a Firebase Database Reference. This is not a breaking change. Thanks, @ryansully! 🎉 - All storage methods now take a
pathOrRef
argument instead of the previouspath
argument. This new argument can be either a string or a Firebase Storage Reference. This is not a breaking change. Thanks, @ryansully! 🎉
Additions
*auth.signInAndRetrieveDataWithCredential(credential)
: login with the given credentials and returns any available additional user information, such as user name.*auth.signInWithCredential(credential)
: login with the given credentials.*auth.signInWithCustomToken(token)
: login with a custom token.*auth.signInWithPhoneNumber(phoneNumber, applicationVerifier)
: login a phone number.*auth.signInWithRedirect(authProvider)
: sign in with an auth provider.*database.sync(path, actionCreator, transform)
: an easy-to-use saga to automatically sync data with your redux store.
Notes
- We now have a documentation site! 🎉
v0.2.0
Updates
- All of the method were moved to namespaces, some of them were renamed:
*rsf.signInAnonymously()
➡️*rsf.auth.signInAnonymously()
*rsf.signInWithPopup(authProvider)
➡️*rsf.auth.signInWithPopup(authProvider)
*rsf.logout()
➡️*rsf.auth.signOut()
rsf.authChannel()
➡️rsf.auth.channel()
*rsf.get(path)
➡️*rsf.database.read(path)
*rsf.create(path, data)
➡️*rsf.database.create(path, data)
*rsf.update(path, data)
➡️*rsf.database.update(path, data)
*rsf.patch(path, data)
➡️*rsf.database.patch(path, data)
*rsf.delete(path)
➡️*rsf.database.delete(path)
rsf.channel(path, event)
➡️rsf.database.channel(path, event)
*rsf.call(functionName, parameters={})
➡️*rsf.functions.call(functionName, parameters={})
rsf.messageChannel()
➡️rsf.messaging.channel()
rsf.tokenRefreshChannel()
➡️rsf.messaging.tokenRefreshChannel()
rsf.upload(path, file, metadata)
➡️rsf.storage.uploadFile(path, file, metadata)
rsf.uploadString(path, string, format metadata)
➡️rsf.storage.uploadString(path, string, format, metadata)
*rsf.getDownloadURL(path)
➡️*rsf.storage.getDownloadURL(path)
*rsf.getFileMetadata(path)
➡️*rsf.storage.getFileMetadata(path)
*rsf.updateFileMetadata(path, newMetadata)
➡️*rsf.storage.updateFileMetadata(path, newMetadata)
*rsf.deleteFile(path)
➡️*rsf.storage.deleteFile(path)
rsf.database.channel(path, event)
(previouslyrsf.channel
) returns a channel which now emits objects instead of single values. This is to allow emittingnull
orundefined
values.
The objects has two keys:snapshot
: a firebase.database.DataSnapshotvalue
: the result ofsnapshot.val()
, which is the actual value stored in the database (any type).
Additions
*rsf.auth.signInWithEmailAndPassword(email, password)
: login with username and password.
Thanks @sarovin! 🎉
Notes
- Coverage increased to 💯% thanks to @ryansully! 🎉
v0.1.0
v0.0.10
- (fix)
rsf.upload
andrsf.uploadString
weren't returning UploadTask object as documented. It is now the case. - Updated firebase dependency to v4