Skip to content

Commit

Permalink
test: 💍 Add semantic-release CI setup
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Oct 10, 2018
1 parent f63aba9 commit ae00110
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
jobs:
build:
docker:
- image: 'circleci/node:latest'
steps:
- checkout
- run:
name: install
command: npm install
- run:
name: release
command: npm run semantic-release || true
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## The Problem

While Firebase's Realtime Database enables you to build almost anything. Manipulating realtime data in your app can lead to quite difficult code to read.
While Firebase's Realtime Database enables you to build almost anything. Manipulating realtime data in your app can lead to writing code that is hard to debug & understand.

## This Solution

Enter MobX. MobX is a powerful state management library that works with all front-end frameworks.

mobx-firebase-database allows you to map your Firebase data to MobX observables and interact with it using MobX
mobx-firebase-database allows you to map your Firebase data to MobX observables and interact with/react to it using MobX.

## Install

Expand Down Expand Up @@ -60,15 +60,10 @@ value.get(); // null

// toMap
const postId = `my_post_id`;
const postsRef = getFirebaseRef({ path: `posts`, orderByKeys: true });
const { value, unsub, update, set } = toMap(postRef);
const postsRef = getFirebaseRef({ path: `posts`, orderByKey: true });
const { value, unsub } = toMap(postRef);
const allPostsIds = value.keys();
const post = value.get(`${postId}`);
/* const posts = value.get(); // always contains the latest value of posts/${postId}
await update({ last_seen_at: firebase.database.ServerValue.TIMESTAMP });
value.get(); // {...post, last_seen_at: number}
await set(null);
value.get(); // null */
```

## API
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mobx-firebase-database",
"version": "0.1.0",
"version": "0.0.0-development",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"types": "dist/index.d.ts",
Expand All @@ -11,7 +11,8 @@
"test": "jest --coverage",
"prepublish": "npm run test && npm run build",
"commit": "git-cz",
"setup:semantic-release": "npx semantic-release-cli setup"
"setup:semantic-release": "npx semantic-release-cli setup",
"semantic-release": "semantic-release"
},
"husky": {
"pre-commit": "prettier src/* --write",
Expand Down

0 comments on commit ae00110

Please sign in to comment.