You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flagon.apache.org by GitBox <gi...@apache.org> on 2021/03/17 14:47:27 UTC

[GitHub] [incubator-flagon-useralejs] poorejc opened a new issue #63: Decorator Syntax Examples

poorejc opened a new issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63


   Users are interested in applying custom labels to their logs. 
   
   There is an easy way to do this through the .log .map and .packageCustomLog exports. 
   
   Some good examples in https://github.com/apache/incubator-flagon-useralejs/blob/master/example/index.js
   
   We should probably start with a new .md  to capture, contextualize, and decompose some of these examples.
   
   Here's one:
   
   ``
   document.addEventListener('click', function(e){
       if (e.target.innerHTML === 'Click Me!') {
           **window.userale.map(function (log) {
               return Object.assign({}, log, { logType: 'custom', customLabel: 'map & packageLog Example' });
           });**
           window.userale.packageLog(e, window.userale.details(window.userale.options(),e.type));
           /**you'll want to reset the map callback function, or set a conditional (e.g., return log), else
            * the callback may be applied to other events of the same class (e.g., click) */
           window.userale.map();
       } else {
           return false
       }
   });
   ``
   
   Here' another
   ``
   `document.addEventListener('change', function(e) {
       if (e.target.value === 'packageCustomLog') {
           window.userale.packageCustomLog({
               customLabel: 'packageCustomLog Example',
               customField1: 'foo',
               customField2: 'bar'},
               function(){return {'foo': 'bar', 'bar': 'foo'}},
               true
               );
       } else {
           return false
       }
   });
   ``


----------------------------------------------------------------
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.

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



[GitHub] [incubator-flagon-useralejs] UncleGedd edited a comment on issue #63: Decorator Syntax Examples

Posted by GitBox <gi...@apache.org>.
UncleGedd edited a comment on issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-802055731


   [PR](https://github.com/apache/incubator-flagon-useralejs/pull/64) that expands on the examples above


-- 
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.

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



[GitHub] [incubator-flagon-useralejs] UncleGedd commented on issue #63: Decorator Syntax Examples

Posted by GitBox <gi...@apache.org>.
UncleGedd commented on issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-802055731


   Linked [PR](https://github.com/apache/incubator-flagon-useralejs/pull/64) that expands on the examples above


-- 
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.

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



[GitHub] [incubator-flagon-useralejs] confusingstraw commented on issue #63: Decorator Syntax Examples

Posted by GitBox <gi...@apache.org>.
confusingstraw commented on issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-801233601


   using:
   \`\`\`js
   // code goes here
   \`\`\`
   will make it appear as a single, highlighted code block. like this:
   ```js
   document.addEventListener('change', function(e) {
     if (e.target.value === 'packageCustomLog') {
       window.userale.packageCustomLog(
         {
           customLabel: 'packageCustomLog Example',
           customField1: 'foo',
           customField2: 'bar'
         },
         function(){ return {'foo': 'bar', 'bar': 'foo'} },
         true
       );
     } else {
       return false
     }
   });
   ```


----------------------------------------------------------------
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.

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



[GitHub] [incubator-flagon-useralejs] asfgit closed issue #63: Decorator Syntax Examples

Posted by GitBox <gi...@apache.org>.
asfgit closed issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63


   


-- 
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.

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



[GitHub] [incubator-flagon-useralejs] poorejc commented on issue #63: Decorator Syntax Examples

Posted by GitBox <gi...@apache.org>.
poorejc commented on issue #63:
URL: https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-801300167


   Damn, I always forget that third apostrophe. Sorry.
   
   > On Mar 17, 2021, at 12:38 PM, Rob ***@***.***> wrote:
   > 
   > 
   > using:
   > ```js
   > // code goes here
   > ```
   > will make it appear as a single, highlighted code block. like this:
   > 
   > document.addEventListener('change', function(e) {
   >   if (e.target.value === 'packageCustomLog') {
   >     window.userale.packageCustomLog(
   >       {
   >         customLabel: 'packageCustomLog Example',
   >         customField1: 'foo',
   >         customField2: 'bar'
   >       },
   >       function(){ return {'foo': 'bar', 'bar': 'foo'} },
   >       true
   >     );
   >   } else {
   >     return false
   >   }
   > });
   > —
   > You are receiving this because you authored the thread.
   > Reply to this email directly, view it on GitHub <https://github.com/apache/incubator-flagon-useralejs/issues/63#issuecomment-801233601>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AC474BWJGZRNOHOO5UZHGDLTEDLI7ANCNFSM4ZKXN22A>.
   > 
   
   


----------------------------------------------------------------
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.

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