poorejc commented on pull request #234:
URL: 
https://github.com/apache/incubator-flagon-useralejs/pull/234#issuecomment-1078708577


   No so fast, I think i have something working built on top of your PR.
   
   See here on a new branch: 
https://github.com/apache/incubator-flagon-useralejs/blob/c482c26b17791130eb77dba32318d352ed560e23/src/main.js#L56-L103
   
   I refactored setup to remove a weirdo else { setup(config)} within the 
`setup` function. I think setup was looping on itself, flipping `config.on = 
true` and restarting `initsender`. I gave it an escape, and modded `start` and 
`stop` to start, halt, and toggle autostart... That seems to work, but could 
use some review from you and @UncleGedd--needs more testing and thinking 
(although units and journeys pass). We should be able to start logging when 
auto is set to false and stop when it's set to true, and persist until the 
other is invoked. That's how it's supposed to work.
   
   If this solution works, then the last step is to flip `getInitialSetting` so 
that autostart is false by default. 
   
   results in set up like this for NPM users:
   
   ```
   import * as userale from 'flagon-userale';
   
   userale.options({
         'autostart': false
   )}
   
   userale.start();
   
   ...
   ```
   
   I think we'll lose the first page load event, but that should be expected if 
youre not initializing userale at first page load (though you could fire off 
userale.start() on a page load event and push a custom log...
   
   Is that the desired behavior? Seems consistent with discussion in #72 .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@flagon.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to