Skip to content
This repository was archived by the owner on Jun 2, 2022. It is now read-only.
This repository was archived by the owner on Jun 2, 2022. It is now read-only.

Work with react native #8

@IanPhilips

Description

@IanPhilips

Hi,

Any idea how to make this work with react native? I tried node-libs-react-native and rn-nodeify to supply the necessary node libraries but I can't source Block via import {Block} from '@ipld/block'
and then calling it like solet block = Block.encoder({hello: 'world'}, 'dag-cbor'); to work:
TypeError: undefined is not an object (evaluating '_block.Block.encoder')

Though if I implement it like so I get a dif undefined error:

    const Block = require('@ipld/block');
    let block = Block.encoder({hello: 'world'}, 'dag-cbor');
    let cid = await block.cid()
    console.log(cid);

gives: TypeError: undefined is not an object (evaluating 'crypto.subtle.digest')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions