Skip to content

Firebase saga push creates a initial key then pushes to firebase with a different key #23

@maitham

Description

@maitham

The firebase saga push method, returns a key, however, it returns a key different to the one created on Firebase. I

ORIGINAL

export function* push(path, fn, getKey) {
  const key = yield call(newKey, path);
  const payload = yield call(fn, key);
  const opts = newOpts('error', 'key');
  const ref = firebase.database().ref(path);
  const [_, { error }] = yield [call([ref, ref.push], payload, opts.handler), take(opts)];
  console.log(_, 'METHOD');
  console.log(error, 'ERROR');
  // console.log(key, 'KEY');
  if (getKey && error == undefined) {
    return key;
  }

  return error;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions