Giter Club home page Giter Club logo

Comments (4)

lingol avatar lingol commented on June 18, 2024

As far as I learned, there's nothing like Parcel in Android.

So no, not in our plans.

from mmkv.

Hao4Chen avatar Hao4Chen commented on June 18, 2024

目前最新版本1.3.5支持boolean, number, bigint, string,boolean[], number[], string[], ArrayBuffer类型,是否可以提供自定义对象的存取接口?如果可以提供的话,麻烦回复一下时间、版本计划,多谢。

1.3.5版本对外导出的 是ets文件, 在鸿蒙工程中无法在ts文件 import ets,导致无法使用。 官方是否有计划 将导出ets文件改为ts, 避免有使用限制。

from mmkv.

lingol avatar lingol commented on June 18, 2024

1.3.5版本对外导出的 是ets文件, 在鸿蒙工程中无法在ts文件 import ets,导致无法使用。 官方是否有计划 将导出ets文件改为ts, 避免有使用限制。

How can one do that? I'd love to know.
MMKV's wrapper is developed in ArtTS and we don't want to change it to TS. How can we export it as TS without changing the MMKV wrapper from .ets to .ts?

from mmkv.

lingol avatar lingol commented on June 18, 2024

For the time being, you can encode/decode the object into JSON first. It's not ideal but it can get you going.

let user = {
  username: 'lingol',
  age: 21
}

// Serialize the object into a JSON string
mmkv.encodeString('user', JSON.stringify(user))

// Deserialize the JSON string into an object
let jsonUser = mmkv.decodeString('user') // { 'username': 'lingol', 'age': 21 }
let userObject = JSON.parse(jsonUser)

from mmkv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.