All Projects → joshforisha → Cycle Fire

joshforisha / Cycle Fire

Licence: mit
A Firebase driver for Cycle.js

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Cycle Fire

Awesome Presentations
A community-curated list of selective conferences around the world for developers
Stars: ✭ 16 (+33.33%)
Mutual labels:  firebase
Greet
Greet is a simple social network for Android written using Firebase Cloud Firestore and Cloud Functions
Stars: ✭ 23 (+91.67%)
Mutual labels:  firebase
Abapfire
ABAP Firebase Client
Stars: ✭ 11 (-8.33%)
Mutual labels:  firebase
Redux Firebase Middleware
🔌 🔥 Redux firebase middleware for React and React-native
Stars: ✭ 17 (+41.67%)
Mutual labels:  firebase
Dva Admin
A dashboard application built upon dva and ant-design
Stars: ✭ 19 (+58.33%)
Mutual labels:  firebase
Chatapp
Chat App with all functionality private chat, contacts, friends request, find friends,for profile settings image cropper functionality, settings, logout also send text, image and all type of files, delete your files for you and everyone , login with email and mobile number and real time database firebase and for notification purpose Node Js used.
Stars: ✭ 25 (+108.33%)
Mutual labels:  firebase
Orm
PHP DataMapper, ORM
Stars: ✭ 827 (+6791.67%)
Mutual labels:  cycle
React Firebase Authentication
🔥 Boilerplate Project for Authentication with Firebase in React.
Stars: ✭ 863 (+7091.67%)
Mutual labels:  firebase
Fsfirestore
Functional F# library to access Firestore database hosted on Google Cloud Platform (GCP) or Firebase.
Stars: ✭ 22 (+83.33%)
Mutual labels:  firebase
Firebase Demo
Stars: ✭ 9 (-25%)
Mutual labels:  firebase
Miteb Frontend
Online portal to book events and rooms for clubs of MIT, Manipal ✨
Stars: ✭ 18 (+50%)
Mutual labels:  firebase
Elmfire Extra
High-level API for ElmFire
Stars: ✭ 18 (+50%)
Mutual labels:  firebase
Hoverboard
Conference website template
Stars: ✭ 935 (+7691.67%)
Mutual labels:  firebase
Thenetwork Open
TheNetwork is a blog cum chat app. It's completely built using firebase. Users can post, comment, like and bookmark the blogs, also users can send follow requests to connect with people. Users can create events and also prepare an event roadmap. Pagination for realtime data is also included in chats, blogs and events.
Stars: ✭ 17 (+41.67%)
Mutual labels:  firebase
Smkcyclescrollview
SMKCycleScrollView - An awesome advertisement cycleScrollView
Stars: ✭ 11 (-8.33%)
Mutual labels:  cycle
Dapp Boilerplate
🌀 Decentralize application boilerplate with React Redux and Firebase integration.
Stars: ✭ 6 (-50%)
Mutual labels:  firebase
Prosemirror Firebase
ProseMirror + Firebase Realtime Database
Stars: ✭ 23 (+91.67%)
Mutual labels:  firebase
Homenaje A Moviefire
Homenaje a MovieFire
Stars: ✭ 12 (+0%)
Mutual labels:  firebase
Rxfirebase
RxJS wrapper with extra goodies for the Firebase JavaScript SDK
Stars: ✭ 11 (-8.33%)
Mutual labels:  firebase
Todo React Redux
Todo app with Create-React-App • React-Redux • Firebase • OAuth
Stars: ✭ 942 (+7750%)
Mutual labels:  firebase

cycle-fire

build npm firebase

A Firebase driver for Cycle.js.

Example

import firebaseConfig from './firebaseConfig';
import { button, div, h2, makeDOMDriver } from '@cycle/dom';
import { firebaseActions, makeFirebaseDriver } from 'cycle-fire';
import { run } from '@cycle/run';

function main(sources) {
  const action$ = sources.DOM
    .select('.shuffle')
    .events('click')
    .map(() => Math.ceil(Math.random() * 99))
    .map(firebaseActions.database.ref('test').set);

  const vdom$ = sources.firebase.database
    .ref('test')
    .value.map(value => div([h2(value), button('.shuffle', 'Shuffle')]));

  return {
    DOM: vdom$,
    firebase: action$
  };
}

run(main, {
  DOM: makeDOMDriver('Application'),
  firebase: makeFirebaseDriver(firebaseConfig)
});

API

firebaseActions

Write effects to the connected Firebase database are requested by calling an action generator—a function defined on the firebaseActions object—and passed to the firebase sink.

<action>.as(category: string)

Effectively attaches a category to the action's result stream, allowing for lookup using the source's select().

import { firebaseActions } from 'cycle-fire';
import xs from 'xstream';

function Cycle(sources) {
  const setAction = firebaseActions.database
    .ref('test')
    .set('newValue')
    .as('setTestValue');

  sources.firebase.select('setTestValue').addListener({
    error: err => {
      console.error(err);
    },
    next: response => {
      console.log(response);
    }
  });

  return {
    firebase: xs.of(setAction)
  };
}

makeFirebaseDriver(config, name?)

  • config: object
    • apiKey: string
    • authDomain: string
    • databaseURL: string
    • messagingSenderId: string
    • projectId: string
    • storageBucket: string
  • name?: string

Initializes a connection to a Firebase database by calling firebase.initializeApp(), returning a source object containing the following:

  • auth: object containing:
  • database: object containing:
    • ref(path: string): ReferenceSource containing:
      • child(path: string): ReferenceSource
      • events(eventType: string): MemoryStream of the ref's eventType events, using Reference.on
      • value: MemoryStream – a shortcut stream equivalent to events('value')
    • refFromURL(url: string): ReferenceSource
  • select(category: string): Stream of results from action requests that were categorized using <action>.as().
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].