- 
                Notifications
    You must be signed in to change notification settings 
- Fork 17
Add Observer class #671
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
Add Observer class #671
Conversation
| This pull request introduces 1 alert when merging 8c5c0fc into 7cf06a5 - view on LGTM.com new alerts: 
 | 
        
          
                src/core/Observer.ts
              
                Outdated
          
        
      | /** | ||
| * Unsubscribe from every collections and clear all the realtime documents. | ||
| */ | ||
| dispose () { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since there is a stop method, i would call it stopAll () instead wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I was thinking about having only one method that can take index & collection, index & collection & documents or nothing to stop subscriptions.
I will update and you can tell me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a nit on naming convention
and also linting is surely necessary :)
| Codecov Report
 
 @@            Coverage Diff             @@
##            7-dev     #671      +/-   ##
==========================================
+ Coverage   83.45%   83.78%   +0.32%     
==========================================
  Files          36       39       +3     
  Lines        1771     1881     +110     
  Branches      325      342      +17     
==========================================
+ Hits         1478     1576      +98     
- Misses        227      237      +10     
- Partials       66       68       +2     
 Continue to review full report at Codecov. 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WIP Review
Co-authored-by: Luca Marchesini <xbill82@gmail.com>
…leio/sdk-javascript into add-observer-and-realtime-documents
Co-authored-by: Luca Marchesini <xbill82@gmail.com>
Co-authored-by: Luca Marchesini <xbill82@gmail.com>
Co-authored-by: Luca Marchesini <xbill82@gmail.com>
…leio/sdk-javascript into add-observer-and-realtime-documents
# [7.8.0](https://github.com/kuzzleio/sdk-javascript/releases/tag/7.8.0) (2021-12-20) #### New features - [ [#671](#671) ] Add Observer class ([Aschen](https://github.com/Aschen)) #### Enhancements - [ [#668](#668) ] Propagates every arguments to Kuzzle ([Aschen](https://github.com/Aschen)) ---
What does this PR do ?
Depends on #672
Add an
Observerclass to manipulateRealtimeDocument.Those documents have the same structure as the
Documentobject from the Document Controller except that they are connected to the realtime engine and their content will mutate when a realtime notification about changes is received.