Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easy Population type function #33

Closed
Bojhan opened this issue Sep 13, 2016 · 3 comments
Closed

Easy Population type function #33

Bojhan opened this issue Sep 13, 2016 · 3 comments
Assignees

Comments

@Bojhan
Copy link
Contributor

Bojhan commented Sep 13, 2016

Just an idea, for a function that might make it a lot easier to retrieve references from other objects. For example if you are restricting your todo list per user.

http://mongoosejs.com/docs/populate.html

It's super useful in the MongoDB space, I haven't really seen it in firebase libraries.

@prescottprue
Copy link
Owner

@Bojhan I really love this idea, and actually worked with a library that a friend made a while back that included similar functionality.

I would be interested to see how the API would look for this. My initial thoughts are just to follow the same pattern with a populate() method, but I am not sure how it would work under the hood with redux (would probably need to use something like normalizr.

@prescottprue prescottprue self-assigned this Sep 23, 2016
@prescottprue
Copy link
Owner

prescottprue commented Sep 27, 2016

I got a simple implementation of this working, looking like this to populate a list of projects that collaborators that is a list of user ids:

projects#populate=collaborators:users

It currently doesn't work right due to #38, so going to solve that first before trying to integrate this.

prescottprue added a commit that referenced this issue Oct 14, 2016
* Information added to README about switch to [react-redux-firebase](https://github.com/prescottprue/react-redux-firebase)
* Population capability described in [#33](#33)
* Handling of updating props within firebase connect fixing [#38](#38)
* Debouncing with toggle through config fixing [#40](#40)
@prescottprue
Copy link
Owner

@Bojhan 1.0.0 release includes population capabilities. The docs include some basic examples, but the will soon be built out more.

Note: The library has been renamed to react-redux-firebase for clarity and to match other redux library naming conventions.

xymw pushed a commit to xymw/redux-firebasev3 that referenced this issue Apr 30, 2017
## Breaking Changes
- Data gathered during population is now normalized in redux [following defined redux practice of normalizing](http://redux.js.org/docs/recipes/reducers/NormalizingStateShape.html) (instead of placed directly into nested object). **THIS BREAKS v1.1.5 AND EARLIER IMPLEMENTATIONS OF POPULATE**. Now population will require the usage of `populatedDataToJS`.
- `populatedDataToJS` function added to helpers (returns data populated from normalized state)
- `profileDecorator` config option renamed to `profileFactory` for clarity (`profileDecorator` still supported, but will throw deprecation warning)
- default file metadata written to database includes `downloadURL` instead of `downloadURLs` array
- Meta values (`timestamp`, `requesting`, `requested`) are now stored by string key (keeps invalid keyPath error from showing up)
- `enableRedirectHandling` config param added to enable/disable auth redirect handling (enabled by default, which can cause breakage in none HTTP/HTTPS environments)

## Enhancements
- `once` queries no longer cause `off` error due to unmounting non existent listener (fixes prescottprue#36)
- login with auth redirect no longer returns null  and other redirect handling improvements (prescottprue#33)
- deep set `invalid keyPath` error fixed in data section of reducer (deep list is null first then has value)
- `fileMetadataFactory` config option added to allow control of metadata written to database when using `uploadFile` and `uploadFiles`
- Profile Params Populate now working for both object and string notation
- Config params type validation
- Roadmap updated with `v2.0.0` plans
- `profileDecorator` backwards compatibility is included (with a deprecation warning)
- `CODE_OF_CONDUCT.md` and `PATRONS.md` added
- Docs + Tests updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants