store (assetType, dataFormat, data, assetId) {
    switch (assetType) {
      case AssetType.ImageBitmap:
      case AssetType.ImageVector:
        return new Promise((resolve, reject) => {
          const uploadTask = this.firebaseStorage.ref().child(`${assetId}.${dataFormat}`)
            .put(data)
          uploadTask.on('state_changed', {
            // next: () => {
            //   console.log("upload uploading")
            // },
            error: error => {
              // console.log("error on firebase upload")
              reject(error)
            },
            complete: () => {
              // console.log("completed firebase upload")
              resolve()
            }
          })
        })
      default:
        return Promise.reject()
    }
  }
/**
   * Stores an asset on Cloud Storage for Firebase. Currently, the returned
   * promise does not provide any status (beyond resolved/rejected), unlike
   * WebHelper.store in scratch-storage, which provides an HTTP response body.
   * @function store
   * @param {AssetType} assetType - The type of asset to store.
   * @param {string} assetId - The ID of the asset to store: a project ID, MD5, etc.
   * @param {DataFormat} dataFormat - The file format / file extension of the asset to store: PNG, JPG, etc.
   * @return {Promise} A promise indicating the success of the attempted
   * storage.
   */
Stores an asset on Cloud Storage for Firebase. Currently, the returned
promise does not provide any status (beyond resolved/rejected), unlike
WebHelper.store in scratch-storage, which provides an HTTP response body.
@function store
@param {AssetType} assetType - The type of asset to store.
@param {string} assetId - The ID of the asset to store: a project ID, MD5, etc.
@param {DataFormat} dataFormat - The file format / file extension of the asset to store: PNG, JPG, etc.
@return {Promise} A promise indicating the success of the attempted
storage.
Stores an asset on Cloud Storage for Firebase . Currently the returned promise does not provide any status ( beyond resolved / rejected ) unlike WebHelper . store in scratch - storage which provides an HTTP response body . @function store @param { AssetType } assetType - The type of asset to store . @param { string } assetId - The ID of the asset to store : a project ID MD5 etc . @param { DataFormat } dataFormat - The file format / file extension of the asset to store : PNG JPG etc . @return { Promise } A promise indicating the success of the attempted storage .
store (assetType, dataFormat, data, assetId) {
    switch (assetType) {
      case AssetType.ImageBitmap:
      case AssetType.ImageVector:
        return new Promise((resolve, reject) => {
          const uploadTask = this.firebaseStorage.ref().child(`${assetId}.${dataFormat}`)
            .put(data)
          uploadTask.on('state_changed', {
            error: error => {
              reject(error)
            },
            complete: () => {
              resolve()
            }
          })
        })
      default:
        return Promise.reject()
    }
  }
store ( assetType , dataFormat , data , assetId ) { switch ( assetType ) { case AssetType . ImageBitmap : case AssetType . ImageVector : return new Promise ( ( resolve , reject ) => { const uploadTask = this . firebaseStorage . ref ( ) . child ( ` ${ assetId } ${ dataFormat } ` ) . put ( data ) uploadTask . on ( 'state_changed' , { error : error => { reject ( error ) } , complete : ( ) => { resolve ( ) } } ) } ) default : return Promise . reject ( ) } }
Stores an asset on Cloud Storage for Firebase.
Stores an asset on Cloud Storage for Firebase .
// next: () => { //   console.log("upload uploading") // }, // console.log("error on firebase upload") // console.log("completed firebase upload")