kettanaito / react-advanced-form

Functional reactive forms. Multi-layer validation, custom styling, field grouping, reactive props, and much more.
https://redd.gitbook.io/react-advanced-form
MIT License
217 stars 24 forks source link

Handle observables memory-wise #340

Open kettanaito opened 6 years ago

kettanaito commented 6 years ago

What:

Why:

To prevent memory leaks due to a bunch of observables established.

How:

kettanaito commented 5 years ago

It may be useful to keep the records of created observables in the form's state. This way whenever a field is registered, and prompts to create an observable, it can look up itself (based on fieldPath) in the form's state, to see if such observable already exists.

This needs to be aligned with the kinds of observables established (rules observer, props observer).