{"id":11542,"date":"2022-09-27T19:56:39","date_gmt":"2022-09-27T14:26:39","guid":{"rendered":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/"},"modified":"2022-09-27T19:56:39","modified_gmt":"2022-09-27T14:26:39","slug":"solved-subscribing-to-a-future-observable","status":"publish","type":"post","link":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/","title":{"rendered":"[Solved] Subscribing to a future observable"},"content":{"rendered":"<p> [ad_1]<br \/>\n<\/p>\n<div id=\"answer-21839376\" class=\"answer js-answer accepted-answer js-accepted-answer\" data-answerid=\"21839376\" data-parentid=\"21836818\" data-score=\"5\" data-position-on-page=\"1\" data-highest-scored=\"1\" data-question-has-accepted-highest-score=\"1\" itemprop=\"acceptedAnswer\" itemscope itemtype=\"https:\/\/schema.org\/Answer\">\n<div class=\"post-layout\">\n<div class=\"votecell post-layout--left\"><\/div>\n<div class=\"answercell post-layout--right\">\n<div class=\"s-prose js-post-body\" itemprop=\"text\">\n<p>The key problem is to find a way to keep an Observer subscribed to a stream whilst tearing down and replacing an underlying source. Let&#8217;s just focus on a single event source &#8211; you should be able to extrapolate from that.<\/p>\n<p>First of all, here is an example class we can use that has a single event <code>SomeEvent<\/code> that follows the standard .NET pattern using an <code>EventHandler&lt;StringEventArgs&gt;<\/code> delegate. We will use this to create sources of events.<\/p>\n<p>Note I have intercepted the event add\/remove handlers in order to show you when Rx subscribes and unsubscribes from the events, and given the class a name property to let us track different instances:<\/p>\n<pre class=\"lang-cs prettyprint-override\"><code>public class EventSource\n{\n    private string _sourceName;\n\n    public EventSource(string sourceName)\n    {\n        _sourceName = sourceName;\n    }\n\n    private event EventHandler&lt;MessageEventArgs&gt; _someEvent;\n\n    public event EventHandler&lt;MessageEventArgs&gt; SomeEvent\n    {\n        add\n        {\n            _someEvent = (EventHandler&lt;MessageEventArgs&gt;)\n                Delegate.Combine(_someEvent, value);\n            Console.WriteLine(\"Subscribed to SomeEvent: \" + _sourceName);\n        }\n        remove\n        {\n            _someEvent = (EventHandler&lt;MessageEventArgs&gt;)\n                Delegate.Remove(_someEvent, value);\n            Console.WriteLine(\"Unsubscribed to SomeEvent: \" + _sourceName);\n        }\n\n    }\n\n    public void RaiseSomeEvent(string message)\n    {\n        var temp = _someEvent;\n        if(temp != null)\n            temp(this, new MessageEventArgs(message));\n    }\n}\n\npublic class MessageEventArgs : EventArgs\n{\n    public MessageEventArgs(string message)\n    {\n        Message = message;\n    }\n\n    public string Message { get; set; }   \n\n    public override string ToString()\n    {\n        return Message;\n    }\n}\n<\/code><\/pre>\n<h3>Solution Key Idea &#8211; StreamSwitcher<\/h3>\n<p>Now, here is the heart of the solution. We will use a <code>Subject&lt;IObservable&lt;T&gt;&gt;<\/code> to create a stream of streams. We can use the <code>Observable.Switch()<\/code> operator to return only the most recent stream to Observers. Here&#8217;s the implementation, and an example of usage will follow:<\/p>\n<pre class=\"lang-cs prettyprint-override\"><code>public class StreamSwitcher&lt;T&gt; : IObservable&lt;T&gt;\n{\n    private Subject&lt;IObservable&lt;T&gt;&gt; _publisher;\n    private IObservable&lt;T&gt; _stream;\n\n    public StreamSwitcher()\n    {\n        _publisher = new Subject&lt;IObservable&lt;T&gt;&gt;();\n        _stream = _publisher.Switch();\n    }\n\n    public IDisposable Subscribe(IObserver&lt;T&gt; observer)\n    {\n        return _stream.Subscribe(observer);\n    }\n\n    public void Switch(IObservable&lt;T&gt; newStream)\n    {\n        _publisher.OnNext(newStream);\n    }\n\n    public void Suspend()\n    {\n        _publisher.OnNext(Observable.Never&lt;T&gt;());\n    }\n\n    public void Stop()\n    {\n        _publisher.OnNext(Observable.Empty&lt;T&gt;());\n        _publisher.OnCompleted();\n    }\n}\n<\/code><\/pre>\n<h3>Usage<\/h3>\n<p>With this class you can hook up a new stream on each occasion you want to start events flowing by using the <code>Switch<\/code> method &#8211; which just sends the new event stream to the <code>Subject<\/code>.<\/p>\n<p>You can unhook events using the <code>Suspend<\/code> method, which sends an <code>Observable.Never&lt;T&gt;()<\/code> to the <code>Subject<\/code> effectively pausing the flow of events.<\/p>\n<p>Finally you can stop altogether by called to <code>Stop<\/code> to push an <code>Observable.Empty&lt;T&gt;() and<\/code>OnComplete()` the subject.<\/p>\n<p>The best part is that this technique will cause Rx to do the right thing and properly unsubscribe from the underlying event sources each time you <code>Switch<\/code>, <code>Suspend<\/code> or <code>Stop<\/code>. Note also, that once <code>Stopped<\/code> no more events will flow, even if you <code>Switch<\/code> again.<\/p>\n<p>Here&#8217;s an example program:<\/p>\n<pre class=\"lang-cs prettyprint-override\"><code>static void Main()\n{\n    \/\/ create the switch to operate on\n    \/\/ an event type of EventHandler&lt;MessageEventArgs&gt;()\n    var switcher = new StreamSwitcher&lt;EventPattern&lt;MessageEventArgs&gt;&gt;();\n\n\n    \/\/ You can expose switcher using Observable.AsObservable() [see MSDN]\n    \/\/ to hide the implementation but here I just subscribe directly to\n    \/\/ the OnNext and OnCompleted events.\n    \/\/ This is how the end user gets their uninterrupted stream:\n    switcher.Subscribe(\n        Console.WriteLine,\n        () =&gt; Console.WriteLine(\"Done!\"));\n\n    \/\/ Now I'll use the example event source to wire up the underlying\n    \/\/ event for the first time\n    var source = new EventSource(\"A\");\n    var sourceObservable = Observable.FromEventPattern&lt;MessageEventArgs&gt;(\n        h =&gt; source.SomeEvent += h,\n        h =&gt; source.SomeEvent -= h);\n\n\n    \/\/ And we expose it to our observer with a call to Switch\n    Console.WriteLine(\"Subscribing\");\n    switcher.Switch(sourceObservable);\n\n    \/\/ Raise some events\n    source.RaiseSomeEvent(\"1\");\n    source.RaiseSomeEvent(\"2\");\n\n    \/\/ When we call Suspend, the underlying event is unwired\n    switcher.Suspend();\n    Console.WriteLine(\"Unsubscribed\");\n\n    \/\/ Just to prove it, this is not received by the observer\n    source.RaiseSomeEvent(\"3\");\n\n    \/\/ Now pretend we want to start events again\n    \/\/ Just for kicks, we'll use an entirely new source of events\n    \/\/ ... but we don't have to, you could just call Switch(sourceObservable)\n    \/\/ with the previous instance.\n    source = new EventSource(\"B\");\n    sourceObservable = Observable.FromEventPattern&lt;MessageEventArgs&gt;(\n        h =&gt; source.SomeEvent += h,\n        h =&gt; source.SomeEvent -= h);\n\n    \/\/ Switch to the new event stream\n    Console.WriteLine(\"Subscribing\");\n    switcher.Switch(sourceObservable);\n\n    \/\/ Prove it works\n    source.RaiseSomeEvent(\"3\");\n    source.RaiseSomeEvent(\"4\");\n\n    \/\/ Finally unsubscribe\n    switcher.Stop();\n}\n<\/code><\/pre>\n<p>This gives output like this:<\/p>\n<pre><code>Subscribing\nSubscribed to SomeEvent: A\n1\n2\nUnsubscribed to SomeEvent: A\nUnsubscribed\nSubscribing\nSubscribed to SomeEvent: B\n3\n4\nUnsubscribed to SomeEvent: B\nDone!\n<\/code><\/pre>\n<p>Note it doesn&#8217;t matter when the end user subscribes &#8211; I did it up front, but they can Subscribe any time and they&#8217;ll start getting events at that point.<\/p>\n<p>Hope that helps! Of course you&#8217;ll need to pull together the various event types of the Geolocator API into a single convenient wrapper &#8211; but this should enable you to get there. <\/p>\n<p>If you have several events you want to combine into a single stream using this technique, look at operators like <code>Merge<\/code>, which requires you to project the source streams into a common type, with <code>Select<\/code> maybe, or something like <code>CombineLatest<\/code> &#8211; this part of the problem shouldn&#8217;t be too tricky.<\/p>\n<\/p><\/div>\n<div class=\"mt24\"><\/div>\n<\/div>\n<p>            <span class=\"d-none\" itemprop=\"commentCount\">4<\/span> <\/p><\/div>\n<\/div>\n<p>[ad_2]<\/p>\n<p>solved Subscribing to a future observable <\/p>\n","protected":false},"excerpt":{"rendered":"<p>[ad_1] The key problem is to find a way to keep an Observer subscribed to a stream whilst tearing down and replacing an underlying source. Let&#8217;s just focus on a single event source &#8211; you should be able to extrapolate from that. First of all, here is an example class we can use that has &#8230; <a title=\"[Solved] Subscribing to a future observable\" class=\"read-more\" href=\"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/\" aria-label=\"More on [Solved] Subscribing to a future observable\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[3157,3156],"class_list":["post-11542","post","type-post","status-publish","format-standard","hentry","category-solved","tag-reactive-programming","tag-system-reactive"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>[Solved] Subscribing to a future observable - JassWeb<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[Solved] Subscribing to a future observable - JassWeb\" \/>\n<meta property=\"og:description\" content=\"[ad_1] The key problem is to find a way to keep an Observer subscribed to a stream whilst tearing down and replacing an underlying source. Let&#8217;s just focus on a single event source &#8211; you should be able to extrapolate from that. First of all, here is an example class we can use that has ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/\" \/>\n<meta property=\"og:site_name\" content=\"JassWeb\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-27T14:26:39+00:00\" \/>\n<meta name=\"author\" content=\"Kirat\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kirat\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/\"},\"author\":{\"name\":\"Kirat\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\"},\"headline\":\"[Solved] Subscribing to a future observable\",\"datePublished\":\"2022-09-27T14:26:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/\"},\"wordCount\":401,\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"keywords\":[\"reactive-programming\",\"system.reactive\"],\"articleSection\":[\"Solved\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/\",\"name\":\"[Solved] Subscribing to a future observable - JassWeb\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\"},\"datePublished\":\"2022-09-27T14:26:39+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/solved-subscribing-to-a-future-observable\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[Solved] Subscribing to a future observable\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#website\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"name\":\"JassWeb\",\"description\":\"Build High-quality Websites\",\"publisher\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#organization\",\"name\":\"Jass Web\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/wp-content\\\/uploads\\\/2021\\\/02\\\/jass-website-logo-1.png\",\"width\":693,\"height\":132,\"caption\":\"Jass Web\"},\"image\":{\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/#\\\/schema\\\/person\\\/65c9c7b7958150c0dc8371fa35dd7c31\",\"name\":\"Kirat\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206\",\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206\",\"contentUrl\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/wp-content\\\/litespeed\\\/avatar\\\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206\",\"caption\":\"Kirat\"},\"sameAs\":[\"http:\\\/\\\/jassweb.com\"],\"url\":\"https:\\\/\\\/jassweb.com\\\/solved\\\/author\\\/jaspritsinghghumangmail-com\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[Solved] Subscribing to a future observable - JassWeb","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/","og_locale":"en_US","og_type":"article","og_title":"[Solved] Subscribing to a future observable - JassWeb","og_description":"[ad_1] The key problem is to find a way to keep an Observer subscribed to a stream whilst tearing down and replacing an underlying source. Let&#8217;s just focus on a single event source &#8211; you should be able to extrapolate from that. First of all, here is an example class we can use that has ... Read more","og_url":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/","og_site_name":"JassWeb","article_published_time":"2022-09-27T14:26:39+00:00","author":"Kirat","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Kirat","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/#article","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/"},"author":{"name":"Kirat","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31"},"headline":"[Solved] Subscribing to a future observable","datePublished":"2022-09-27T14:26:39+00:00","mainEntityOfPage":{"@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/"},"wordCount":401,"publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"keywords":["reactive-programming","system.reactive"],"articleSection":["Solved"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/","url":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/","name":"[Solved] Subscribing to a future observable - JassWeb","isPartOf":{"@id":"https:\/\/jassweb.com\/solved\/#website"},"datePublished":"2022-09-27T14:26:39+00:00","breadcrumb":{"@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jassweb.com\/solved\/solved-subscribing-to-a-future-observable\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jassweb.com\/solved\/"},{"@type":"ListItem","position":2,"name":"[Solved] Subscribing to a future observable"}]},{"@type":"WebSite","@id":"https:\/\/jassweb.com\/solved\/#website","url":"https:\/\/jassweb.com\/solved\/","name":"JassWeb","description":"Build High-quality Websites","publisher":{"@id":"https:\/\/jassweb.com\/solved\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jassweb.com\/solved\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jassweb.com\/solved\/#organization","name":"Jass Web","url":"https:\/\/jassweb.com\/solved\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/","url":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","contentUrl":"https:\/\/jassweb.com\/wp-content\/uploads\/2021\/02\/jass-website-logo-1.png","width":693,"height":132,"caption":"Jass Web"},"image":{"@id":"https:\/\/jassweb.com\/solved\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/jassweb.com\/solved\/#\/schema\/person\/65c9c7b7958150c0dc8371fa35dd7c31","name":"Kirat","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206","url":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206","contentUrl":"https:\/\/jassweb.com\/solved\/wp-content\/litespeed\/avatar\/1261af3c9451399fa1336d28b98ea3bb.jpg?ver=1777613206","caption":"Kirat"},"sameAs":["http:\/\/jassweb.com"],"url":"https:\/\/jassweb.com\/solved\/author\/jaspritsinghghumangmail-com\/"}]}},"_links":{"self":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/11542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/comments?post=11542"}],"version-history":[{"count":0,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/posts\/11542\/revisions"}],"wp:attachment":[{"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/media?parent=11542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/categories?post=11542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jassweb.com\/solved\/wp-json\/wp\/v2\/tags?post=11542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}