{"id":17195,"date":"2022-04-18T09:26:28","date_gmt":"2022-04-18T09:26:28","guid":{"rendered":"http:\/\/625cabddcabe89001d0d4595"},"modified":"2025-01-07T04:39:10","modified_gmt":"2025-01-07T03:39:10","slug":"custom-rxjs-store-architecture-2","status":"publish","type":"post","link":"https:\/\/dassiorleando.com\/fr\/custom-rxjs-store-architecture-2\/","title":{"rendered":"Custom State Management Architecture using RxJS"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"introduction\">Introduction<\/h2>\n\n\n\n<p>As a developer, building frontend applications is becoming less difficult using a set of techniques that have been standardized with time, within that jargon, one of these is the <strong>State Management System<\/strong> which is a hype amongst frontend developers using frameworks like Angular, React, VueJS, and so on. Simply said, it\u2019s commonly referred to as a <strong>store<\/strong> or a <strong>global<\/strong> JavaScript object shareable between UI components.<\/p>\n\n\n\n<p>In this article, I will walk you through a basic yet solid RxJS implementation of a custom store usable for some specific cases to make your DOM elements more reactive without adding many batteries to your code.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The <strong>YouTube Channels<\/strong> in both English (En) and French (Fr) are now accessible, feel free to subscribe by clicking <a href=\"https:\/\/www.youtube.com\/@numericaideas\/channels?sub_confirmation=1\">here<\/a>.<\/p>\n<\/blockquote>\n\n\n<div class=\"vlp-link-container vlp-layout-basic wp-block-visual-link-preview-link\"><a href=\"https:\/\/www.youtube.com\/@numericaideas\/channels?sub_confirmation=1\" class=\"vlp-link\" title=\"Numerica Ideas\" rel=\"nofollow\" target=\"_blank\"><\/a><div class=\"vlp-layout-zone-side\"><div class=\"vlp-block-2 vlp-link-image\"><img decoding=\"async\" src=\"https:\/\/yt3.googleusercontent.com\/klwPa3fnccvxnvUjmfGmcdJDeX8J7BMbRraxiH69WeLx6qr3fQdxYSGN37vKE4jBCqGX5pZCgQ=s900-c-k-c0x00ffffff-no-rj\" style=\"max-width: 150px; max-height: 150px\" \/><\/div><\/div><div class=\"vlp-layout-zone-main\"><div class=\"vlp-block-0 vlp-link-title\">Numerica Ideas<\/div><div class=\"vlp-block-1 vlp-link-summary\">NumericaIdeas is a technical community that creates opportunities for IT professionals, where you\u2019ll secure your dream job, and indeed the group through which you can develop your hard and soft skills at your own pace. Our motto is \u201cDiscover, Learn, Build, &amp; Share\u201d \ud83d\ude80 \ud83d\udca1 La cha\u00eene est aussi disponi\u2026<\/div><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\" id=\"why-a-state-management-system\">Why a State Management System?<\/h2>\n\n\n\n<p>As introduced earlier, it\u2019s just like a global variable where you keep the data that flow through your components, a fashioned way to reactively load and populate data on the UI using a common syntax that boils down to the definition of <strong>Actions<\/strong>, <strong>Effects,<\/strong> and <strong>Reducers<\/strong>.<\/p>\n\n\n\n<p>It\u2019s always a hard question to determine if we need such a pattern within our App, but it\u2019s a good idea to consider for any App projected to scale in a medium or long-term plan since it reduces the complexity while updating non-related UI elements.<\/p>\n\n\n\n<p>They are used to delegate a specific file\/function to act, once the result is generated, it\u2019s saved (state change), then it fires an event to notify DOM elements that need it, and the UI refreshes for the end-user to see the expected content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"difference-between-ngrx-store-and-rxjs\">Difference Between NgRx\/Store and RxJS<\/h2>\n\n\n\n<p>By focusing on <a href=\"https:\/\/ngrx.io\/\"><strong>NgRx<\/strong><\/a> (for Angular developers) I\u2019m outlining a clear difference as a transition to the main focus of this article, both systems tend to solve the same problem, at least they are both reactive and can keep our App\u2019s data ready to be ingested by components. It\u2019s important to differentiate that <strong>NgRxStore<\/strong> is the implementation of <strong>Redux<\/strong> pattern using <strong>RxJS<\/strong> underneath, so it defines a nice syntax shareable amongst developers to solve the same problem.<\/p>\n\n\n\n<p><strong><a href=\"https:\/\/rxjs.dev\/\">RxJS<\/a><\/strong> is a JS library that empowers so many others by adding reactive programming within our App, it has been used in so many ways to perform that same reactivity using different patterns\/syntaxes, that\u2019s why today we have frameworks like:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/ngrx.io\/\">NgRx<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.ngxs.io\/\">NGXS<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/opensource.salesforce.com\/akita\/\">Akita<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"do-i-need-any-state-library\">Do I Need any State Library?<\/h2>\n\n\n\n<p>It&#8217;s pretty common to see newcomers using state libraries implicitly, more advised ones always have that question on their table when they have new projects to build, DO I NEED IT SOON OR LATER?<\/p>\n\n\n\n<p>State management libraries are shiny, and good but do we always need these? I agree that with the new agility brought in by modern Apps, we need a better separation of concerns and well-defined patterns, but is that a reason to directly include <strong>NgRx<\/strong> (or any alternatives) in our project instead of creating basic RxJS\u2019s Subjects for Apps in need of minimal efforts? Is the learning curve not a pain for the project delivery?<\/p>\n\n\n\n<p>In a few of my former professional missions, I favored a custom implementation that doesn\u2019t imply any learning effort because I wanted to have something understandable by any JS developers. I did that primarily based on the size of the project (generally small and around medium ones) and the skill set of the team (not an opinion in stone).<\/p>\n\n\n\n<p>Some of these libraries come with a set of rules for you to decide if you should include these in your project or not, but it\u2019s not the purpose of this write-up, for more information or decision triggers you can take a look at this <a href=\"https:\/\/www.tsmean.com\/articles\/angular\/ngrxstore-vs-angular-services\/\">article<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"custom-angular-store-using-rxjs\">Custom Angular Store using RxJS<\/h2>\n\n\n\n<p>Building a store using <strong>RxJS<\/strong> gives more confidence with the fact that most of the <strong>JS developers<\/strong> will quickly get familiar with the syntax since it&#8217;s the same basic functions and calls being done no matter the programming languages (nothing new), the only addition is the <strong>Reactivity (live updates)<\/strong> brought in by this framework.<\/p>\n\n\n\n<p>A second and very important advantage is the ability to quickly export almost the same code to other frontend projects (not frontend framework dependant) and it&#8217;s going to work with very less code changes, as soon as the <strong>RxJS<\/strong> package is included as a dependency.<\/p>\n\n\n\n<p>Let me guide you through what I used to implement for Angular App respecting the context I highlighted in the previous section, the same applies to other frontend frameworks (React &#8230;), which consist of:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>An interface the state services must implement.<\/li>\n\n\n\n<li>Some models describe the information managed by state services.<\/li>\n\n\n\n<li>A global state service that handles the App global state.<\/li>\n\n\n\n<li>Multiple local\/specific state services for some particular scenarios.<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/numerica-ideas\/custom-angular-store\/master\/architecture.drawio.svg\" alt=\"Custom State Management Architecture using RxJS\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"the-state-interface\">The State Interface<\/h3>\n\n\n\n<p>There is the concept of global and local\/specific states, both sharing the same core definition but are being used differently depending on the context, within their similarities the functions <strong>set<\/strong> and <strong>get<\/strong> are very important:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The &#8216;set&#8217; function updates the state value.<\/li>\n\n\n\n<li>The &#8216;get&#8217; function returns a specific subject for further subscriptions (listening to changes).<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">export interface StateInterface {\n    \/**\n     * Gets a state subject to listen to.\n     *\/\n    get(): BehaviorSubject&lt;any>;\n    \/**\n     * Sets a global\/specific state value (object).\n     * @param object The object to set as state value.\n     *\/\n    set(object: any): void;\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"state-models\">State Models<\/h3>\n\n\n\n<p>The state models are just plain TypeScript definitions of some fields, let&#8217;s notice the inclusion of a local\/specific state (<strong>BookState<\/strong>) into the global one:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">\/**\n * The specific book state model.\n *\/\nexport interface BookState {\n    title?: string;\n    year?: number;\n    author?: string;\n}<\/pre>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">\/**\n * The global custom state model.\n *\/\nexport interface CustomState {\n    fieldA?: string;\n    fieldB?: string;\n    year?: number;\n    book?: BookState;\n    \/\/ ...\n    \/\/ etc.\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"global-and-specific-state-services\">Global and Specific State Services<\/h3>\n\n\n\n<p>By calling the states&#8217; services <strong>set<\/strong> functions, we can update the content of the states regardless if it&#8217;s a global or a specific one.<\/p>\n\n\n\n<p>Included in this sample architecture is a <strong>BookService<\/strong> to keep a book (selected) in our store, and once updated, the change is reported to the global state service as shown in the following lines of codes:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">@Injectable({ providedIn: 'root' })\nexport class BookService implements StateInterface {\n    private bookSubject: BehaviorSubject&lt;BookState> = new BehaviorSubject&lt;BookState>(DEFAULT_BOOK);\n    constructor(private stateService: StateService) {}\n    \/**\n     * Returns the book details.\n     *\/\n    get(): BehaviorSubject&lt;BookState> {\n        return this.bookSubject;\n    }\n    \/**\n     * Applies some changes to the book state.\n     * @param stateChanges The changes (an object) to populate.\n     *\/\n    set(stateChanges: BookState): void {\n        if (!stateChanges) return;\n        const book: BookState = { ...this.bookSubject.getValue(), ...stateChanges };\n        this.bookSubject.next(book);\n        this.stateService.set({ book });\n    }\n}<\/pre>\n\n\n\n<p>The specific states&#8217; services can be used directly once injected, but providing a facade to these appeared more centralized and easier to manage along the way. This means all the actions being done by those specific states should be able to be found in the global one.<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">@Injectable({ providedIn: 'root' })\nexport class StateService implements StateInterface {\n    private stateSubject: BehaviorSubject&lt;CustomState> = new BehaviorSubject&lt;CustomState>({ book: DEFAULT_BOOK });\n    \/\/ ...\n    \/**\n     * Applies some changes to the global state.\n     * @param stateChanges The changes (an object) to populate.\n     *\/\n    set(stateChanges: CustomState): void {\n        if (!stateChanges) return;\n        const currentStateValue = this.stateSubject.getValue();\n        this.stateSubject.next({ ...currentStateValue, ...stateChanges });\n    }\n    \/**\n     * Gets a global\/specific state value by its key.\n     * @param key Optional key, if not provided we return the global state object.\n     *\/\n    value(key = ''): any {\n        const globalState: any = this.stateSubject.getValue();\n        return key ? globalState[key] : globalState;\n    }\n    \/\/ ...\n    \/**\n     * Sets the book details.\n     * @param details A book object with many fields.\n     *\/\n    setBookDetails(details: BookState): void {\n        this.bookService.set(details);\n    }\n}<\/pre>\n\n\n\n<p>So from anywhere within the App, by calling <a href=\"https:\/\/github.com\/numerica-ideas\/custom-angular-store\/blob\/master\/src\/app\/custom-store\/services\/state.service.ts#L76\"><strong>setBookDetails<\/strong><\/a>, the selected book will be updated and the changes propagated to all listeners of the <a href=\"https:\/\/rxjs.dev\/guide\/observable\">RxJS observable<\/a>, a BehaviorSubject is an Observable by inheritance.<\/p>\n\n\n\n<p>Once the services are configured normally, from any components we can simply load the App state like the following:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">currentState$: BehaviorSubject&lt;CustomState> = this.stateService.get();<\/pre>\n\n\n\n<p>Then, in the template, it\u2019s possible to show that observable once it&#8217;s accessible using the <strong>async<\/strong> pipe:<\/p>\n\n\n\n<pre class=\"wp-block-syntaxhighlighter-code\">&lt;div>{{ currentState$ | async }}&lt;\/div><\/pre>\n\n\n\n<p>Read more about <strong>RxJS Observables<\/strong> in the article titled &#8220;<a href=\"https:\/\/numericaideas.com\/blog\/difference-between-rxjs-observable-subject-and-behaviorsubject\/\">Difference between RxJS Observable, Subject, and BehaviorSubject<\/a>&#8220;:<\/p>\n\n\n<div class=\"vlp-link-container vlp-layout-basic wp-block-visual-link-preview-link\"><a href=\"https:\/\/numericaideas.com\/blog\/difference-between-rxjs-observable-subject-and-behaviorsubject\/\" class=\"vlp-link\" title=\"Difference between RxJS Observable, Subject, and BehaviorSubject\" rel=\"nofollow\" target=\"_blank\"><\/a><div class=\"vlp-layout-zone-side\"><div class=\"vlp-block-2 vlp-link-image\"><img decoding=\"async\" src=\"https:\/\/assets.numericaideas.com\/2023\/05\/RxJS-Observables-Difference-1-min.png\" style=\"max-width: 150px; max-height: 150px\" \/><\/div><\/div><div class=\"vlp-layout-zone-main\"><div class=\"vlp-block-0 vlp-link-title\">Difference between RxJS Observable, Subject, and BehaviorSubject<\/div><div class=\"vlp-block-1 vlp-link-summary\">Understanding the difference between Observable, Subject, and BehaviorSubject is important while building Reactive Apps using RxJS, which this article intends to outline.<\/div><\/div><\/div>\n\n\n<h2 class=\"wp-block-heading\">Demo<\/h2>\n\n\n\n<p>To test this implementation, you can get the <a href=\"https:\/\/github.com\/numerica-ideas\/custom-angular-store\">full source code<\/a> available on GitHub. From within the root folder, you should install the dependencies using the command <code>npm install<\/code>, and run the App with <code>npm start<\/code> to have the page accessible at <a href=\"http:\/\/localhost:4200\/\">http:\/\/localhost:4200<\/a> which is similar to the following screenshot:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/assets.numericaideas.com\/2022\/04\/custom-angular-store-demo.png\" alt=\"Custom State Management Architecture using RxJS\"\/><\/figure>\n\n\n\n<p>By clicking on the button <strong>BOOM<\/strong>, the book&#8217;s <strong>title<\/strong> and <strong>year<\/strong> are updated so the changes are being reflected in the global state <strong>Observable<\/strong> printed in the black terminal display just down.<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n\n\n\n<p>We have just started our journey to build a network of professionals to grow even more our free knowledge-sharing community that will give you a chance to learn interesting things about topics like cloud computing, software development, and software architectures while keeping the door open to more opportunities.<\/p>\n\n\n\n<p>Does this speak to you? If <strong>YES<\/strong>, feel free to <a href=\"https:\/\/discord.numericaideas.com\">Join our Discord Server<\/a> to stay in touch with the community and be part of independently organized events.<\/p>\n\n\n\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>In the end, it doesn\u2019t matter what decision you take for your team or project, provided that you narrow down what fits best to your setup depending on your experience and time. Even if the RxJS approach seems very comfortable to any developer, your team may also be very familiar with and good enough to practice state management regardless of the patterns in place.<\/p>\n\n\n\n<p>Thanks for reading this article. Like, recommend, and share if you enjoyed it. Follow us on <a href=\"https:\/\/www.facebook.com\/numericaideas\" rel=\"nofollow\">Facebook<\/a>, <a href=\"https:\/\/twitter.com\/numericaideas\" rel=\"nofollow\">Twitter<\/a>, and <a href=\"https:\/\/www.linkedin.com\/company\/numericaideas\" rel=\"nofollow\">LinkedIn<\/a> for more content.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.<\/p>","protected":false},"author":2,"featured_media":18739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[70,79],"tags":[48,71],"class_list":["post-17195","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-architecture","category-frontend","tag-angular","tag-software-architecture"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Custom State Management Architecture using RxJS<\/title>\n<meta name=\"description\" content=\"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/\" \/>\n<meta property=\"og:locale\" content=\"fr_CA\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Custom State Management Architecture using RxJS\" \/>\n<meta property=\"og:description\" content=\"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/\" \/>\n<meta property=\"og:site_name\" content=\"Orleando Dassi\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-18T09:26:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-07T03:39:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Orl\u00e9ando Dassi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dassiorleando\" \/>\n<meta name=\"twitter:site\" content=\"@dassiorleando\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Orl\u00e9ando Dassi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/\"},\"author\":{\"name\":\"Orl\u00e9ando Dassi\",\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e\"},\"headline\":\"Custom State Management Architecture using RxJS\",\"datePublished\":\"2022-04-18T09:26:28+00:00\",\"dateModified\":\"2025-01-07T03:39:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/\"},\"wordCount\":1416,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e\"},\"image\":{\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png\",\"keywords\":[\"angular\",\"Software Architecture\"],\"articleSection\":[\"Architecture\",\"Frontend\"],\"inLanguage\":\"fr-CA\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/\",\"url\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/\",\"name\":\"Custom State Management Architecture using RxJS\",\"isPartOf\":{\"@id\":\"https:\/\/dassiorleando.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png\",\"datePublished\":\"2022-04-18T09:26:28+00:00\",\"dateModified\":\"2025-01-07T03:39:10+00:00\",\"description\":\"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.\",\"breadcrumb\":{\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#breadcrumb\"},\"inLanguage\":\"fr-CA\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-CA\",\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage\",\"url\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png\",\"contentUrl\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png\",\"width\":1366,\"height\":768,\"caption\":\"Custom State Management Architecture using RxJS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dassiorleando.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Custom State Management Architecture using RxJS\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dassiorleando.com\/#website\",\"url\":\"https:\/\/dassiorleando.com\/\",\"name\":\"Orleando Dassi\",\"description\":\"My personal portfolio and resume\",\"publisher\":{\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dassiorleando.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-CA\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e\",\"name\":\"Orl\u00e9ando Dassi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-CA\",\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2025\/01\/Orleando-Dassi-Consultant-Quebec.webp\",\"contentUrl\":\"https:\/\/dassiorleando.com\/wp-content\/uploads\/2025\/01\/Orleando-Dassi-Consultant-Quebec.webp\",\"width\":1643,\"height\":1747,\"caption\":\"Orl\u00e9ando Dassi\"},\"logo\":{\"@id\":\"https:\/\/dassiorleando.com\/#\/schema\/person\/image\/\"},\"description\":\"I'm a Solutions Architect with 10 years of experience who is constantly learning while impacting the community by producing technical articles\/videos, building projects, and conducting tech mentoring\/coaching sessions. What describes me the most is my flexibility.\",\"sameAs\":[\"https:\/\/dassiorleando.com\/\",\"https:\/\/www.instagram.com\/dassiorleando\/\",\"https:\/\/www.linkedin.com\/in\/dassi-orleando-257b04ab\/\",\"https:\/\/x.com\/dassiorleando\",\"https:\/\/www.youtube.com\/@dassiorleando\"],\"url\":\"https:\/\/dassiorleando.com\/fr\/author\/dassiorleando\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Custom State Management Architecture using RxJS","description":"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.","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:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/","og_locale":"fr_CA","og_type":"article","og_title":"Custom State Management Architecture using RxJS","og_description":"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.","og_url":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/","og_site_name":"Orleando Dassi","article_published_time":"2022-04-18T09:26:28+00:00","article_modified_time":"2025-01-07T03:39:10+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png","type":"image\/png"}],"author":"Orl\u00e9ando Dassi","twitter_card":"summary_large_image","twitter_creator":"@dassiorleando","twitter_site":"@dassiorleando","twitter_misc":{"Written by":"Orl\u00e9ando Dassi","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#article","isPartOf":{"@id":"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/"},"author":{"name":"Orl\u00e9ando Dassi","@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e"},"headline":"Custom State Management Architecture using RxJS","datePublished":"2022-04-18T09:26:28+00:00","dateModified":"2025-01-07T03:39:10+00:00","mainEntityOfPage":{"@id":"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/"},"wordCount":1416,"commentCount":0,"publisher":{"@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e"},"image":{"@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png","keywords":["angular","Software Architecture"],"articleSection":["Architecture","Frontend"],"inLanguage":"fr-CA","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dassiorleando.com\/custom-rxjs-store-architecture-2\/","url":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/","name":"Custom State Management Architecture using RxJS","isPartOf":{"@id":"https:\/\/dassiorleando.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage"},"image":{"@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage"},"thumbnailUrl":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png","datePublished":"2022-04-18T09:26:28+00:00","dateModified":"2025-01-07T03:39:10+00:00","description":"RxJS implementation of a custom store useful in some specific cases to add reactivity to your DOM elements without adding many batteries to your code.","breadcrumb":{"@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#breadcrumb"},"inLanguage":"fr-CA","potentialAction":[{"@type":"ReadAction","target":["https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/"]}]},{"@type":"ImageObject","inLanguage":"fr-CA","@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#primaryimage","url":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png","contentUrl":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2022\/04\/NI-Custom-State-Management-1-min.png","width":1366,"height":768,"caption":"Custom State Management Architecture using RxJS"},{"@type":"BreadcrumbList","@id":"https:\/\/numericaideas.com\/blog\/custom-rxjs-store-architecture\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dassiorleando.com\/"},{"@type":"ListItem","position":2,"name":"Custom State Management Architecture using RxJS"}]},{"@type":"WebSite","@id":"https:\/\/dassiorleando.com\/#website","url":"https:\/\/dassiorleando.com\/","name":"Orleando Dassi","description":"My personal portfolio and resume","publisher":{"@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dassiorleando.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-CA"},{"@type":["Person","Organization"],"@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/4862911e9cf93aa12f17875f7b7b1c5e","name":"Orl\u00e9ando Dassi","image":{"@type":"ImageObject","inLanguage":"fr-CA","@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/image\/","url":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2025\/01\/Orleando-Dassi-Consultant-Quebec.webp","contentUrl":"https:\/\/dassiorleando.com\/wp-content\/uploads\/2025\/01\/Orleando-Dassi-Consultant-Quebec.webp","width":1643,"height":1747,"caption":"Orl\u00e9ando Dassi"},"logo":{"@id":"https:\/\/dassiorleando.com\/#\/schema\/person\/image\/"},"description":"I'm a Solutions Architect with 10 years of experience who is constantly learning while impacting the community by producing technical articles\/videos, building projects, and conducting tech mentoring\/coaching sessions. What describes me the most is my flexibility.","sameAs":["https:\/\/dassiorleando.com\/","https:\/\/www.instagram.com\/dassiorleando\/","https:\/\/www.linkedin.com\/in\/dassi-orleando-257b04ab\/","https:\/\/x.com\/dassiorleando","https:\/\/www.youtube.com\/@dassiorleando"],"url":"https:\/\/dassiorleando.com\/fr\/author\/dassiorleando\/"}]}},"_links":{"self":[{"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/posts\/17195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/comments?post=17195"}],"version-history":[{"count":1,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/posts\/17195\/revisions"}],"predecessor-version":[{"id":21675,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/posts\/17195\/revisions\/21675"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/media\/18739"}],"wp:attachment":[{"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/media?parent=17195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/categories?post=17195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dassiorleando.com\/fr\/wp-json\/wp\/v2\/tags?post=17195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}