JSCollectionExtensions.AsReadOnlyDictionary<TValue> method (1 of 2)
Creates a read-only dictionary adapter for properties of a JS object, without copying.
C#
public static IReadOnlyDictionary<string, TValue> AsReadOnlyDictionary<TValue>(this JSObject obj,
To<TValue> valueFromJS)
Remarks
This method must be called from the JS thread. The returned dictionary object is thread-safe and may be accessed from threads other than the JS thread (though accessing from the JS thread is more efficient).
See Also
- struct JSObject
- delegate To<T>
- class JSCollectionExtensions
- namespace Microsoft.JavaScript.NodeApi.Interop
JSCollectionExtensions.AsReadOnlyDictionary<TKey,TValue> method (2 of 2)
Creates a read-only dictionary adapter for a JS Map object, without copying.
C#
public static IReadOnlyDictionary<TKey, TValue> AsReadOnlyDictionary<TKey, TValue>(this JSMap map,
To<TKey> keyFromJS, To<TValue> valueFromJS, From<TKey> keyToJS)
Remarks
This method must be called from the JS thread. The returned dictionary object is thread-safe and may be accessed from threads other than the JS thread (though accessing from the JS thread is more efficient).
See Also
- struct JSMap
- delegate To<T>
- delegate From<T>
- class JSCollectionExtensions
- namespace Microsoft.JavaScript.NodeApi.Interop