Giter Site home page Giter Site logo

luistak / windowed-observable Goto Github PK

View Code? Open in Web Editor NEW
159.0 2.0 16.0 4.1 MB

Messaging lib using a pub/sub observable scoped by namespaces.

License: MIT License

TypeScript 94.32% JavaScript 5.68%
hacktoberfest react windowed microfrontend microfrontends communication pubsub observable namespaces topic

windowed-observable's Introduction

windowed-observable

Windowed observable

The home for all windowed-observable projects


Npm version Build Size License PRs Welcome Downloads

Introduction

Problem

In a micro frontends setup, one of the main problems is cross application communication and this library aims to solve it by providing a simple and framework agnostic API with zero configuration

Solution

Exposing an observable that behaves like scoped a pub/sub topic passing events per namespaces.

This Observable is exported by the core package windowed-observable with the following features:

โœจ Features

  • ๐Ÿ“ฆ Scoped events by namespaces
  • ๐ŸŽฃ Events history retrieval with SubscriptionOptions
  • ๐Ÿ›ก 100% Written in TypeScript with static types

Packages

  • windowed-observable is a library for messaging using Observables, making it easier to communicate multiple apps or parts of an app using the window. It exposes an Observable that behaves like a scoped pub/sub topic using namespaces.

  • react-windowed-observable is a react abstraction over windowed-observable exposing a helper that creates a scoped Context to handle events in a specific namespace

windowed-observable's People

Contributors

dependabot[bot] avatar luistak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

windowed-observable's Issues

Update docs and examples with latest APIs

Describe the feature you'd like:

It would be nice to update both packages documentation and examples to reflects the newest changes made in this PR #164

Suggested implementation:

Update README.md files along with examples, following the existent ones.

Please clarify using `DataType` for code completion

Hey, I'm having some trouble with code completion when I do this in my code:

export const loginObservable = createReactObservable<{ user: User | null }>(...)

The code that uses the above:

import { loginObservable } from "user"; // some imported workspace module

const {
  ObservableProvider: LoginProvider,
  useObservable: useLoginObservable,
} = loginObservable;

function App() {
  const { data } = useLoginObservable();
  ///...

Now, in VS Code, when I type data. I don't get any suggestions for 'user' whatsoever. I dug into the library's types and found:

export type DataType<T> = T | T[] | undefined;

Which is a bit unclear to me. Values in the 'event bus' can be either arrays or singular values? If so how would I use this with proper type checking? Thanks.

Why does package.json includes react and react-dom?

Hello. I want to add the ability to provide the global object that will be used as the communication foundation as opposed to have the code assume it is the window object. This because I have been unable to fiddle around with this code in NodeJS, and window mocks and replacements haven't proved fruitful for me.

Anyway, back to my question: If there's a specialized package for React, why does this one (the generic version) has React in its dependencies? Can those packages be removed?

Add async pipe support

Describe the feature you'd like:

I would like to have a possibility to use windowed-observable directly in a html-template via async pipe.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.