medikoo / medikoo/dbjs

More natural configuration of object streams

Open
#48 1 comment 0 reactions 1 assignee View on GitHub

@medikoo is already working on this.

Since Jan 11, 2016.

Dominant language
JavaScript
Stars
27
Forks
4
PR merge metrics
No merged PRs in 30d

Description

/cc @kamsi

Currently when we want to configure some action on when given object receives certain state, we usually build collection as e.g.

db.BusinessProcess.filterByKey('isRevisionReady', true).on(function (event) { ... });

What's painful is that usually we rewrite similar event handler which works around add, delete, batch events. It might be nicer if we can achieve same via something as:

db.BusinessProcess.stream('isRevisionReady', true).on(function (businessProcess) { .. });

This stream will also at initialization stream all objects that already match expected state.

Additional functionality would be to create a streams that are also guarded by pre-triggers, so we observe specific state change from A to B, and not just fact that object landed at given state.
Very rough idea, on how it may look:

db.BusinessProcess.stream('isRevisionReady', true)
  .to('isRevisionApproved', true).on(function (businessProcess) { .. });

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.